Esempio n. 1
0
 def test_suppress_deprecation_with_warning_filter(self):
     """don't suppress if we already have a filter"""
     warnings.filterwarnings('error', category=Warning)
     self.assertFirstWarning('error', Warning)
     self.assertEqual(1, len(warnings.filters))
     symbol_versioning.suppress_deprecation_warnings(override=False)
     self.assertFirstWarning('error', Warning)
     self.assertEqual(1, len(warnings.filters))
Esempio n. 2
0
 def test_set_restore_filters(self):
     original_filters = warnings.filters[:]
     symbol_versioning.suppress_deprecation_warnings()()
     self.assertEqual(original_filters, warnings.filters)
Esempio n. 3
0
 def test_suppress_deprecation_warnings(self):
     """suppress_deprecation_warnings sets DeprecationWarning to ignored."""
     symbol_versioning.suppress_deprecation_warnings()
     self.assertFirstWarning('ignore', DeprecationWarning)