~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_symbol_versioning.py

  • Committer: Robert Collins
  • Date: 2010-06-25 06:11:21 UTC
  • mto: This revision was merged to the branch mainline in revision 5324.
  • Revision ID: robertc@robertcollins.net-20100625061121-0cx949gxhae5aeib
The symbol_versioning module can now cleanup after itself -
``suppress_deprecation_warnings`` now returns a cleanup function.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
        symbol_versioning.suppress_deprecation_warnings()
242
242
        self.assertFirstWarning('ignore', DeprecationWarning)
243
243
 
 
244
    def test_set_restore_filters(self):
 
245
        original_filters = warnings.filters[:]
 
246
        symbol_versioning.suppress_deprecation_warnings()()
 
247
        self.assertEqual(original_filters, warnings.filters)
 
248
 
244
249
    def test_suppress_deprecation_with_warning_filter(self):
245
250
        """don't suppress if we already have a filter"""
246
251
        warnings.filterwarnings('error', category=Warning)