Permalink
Browse files

Added test about error filterwarnings

Refs #20083.
  • Loading branch information...
1 parent 0c6a339 commit 8446a2438ffeab845e31cba4489f03fccc387298 @claudep claudep committed Mar 8, 2014
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/logging_tests/tests.py
@@ -128,6 +128,16 @@ def test_warnings_capture_debug_false(self):
output = force_text(self.outputs[0].getvalue())
self.assertFalse('Foo Deprecated' in output)
+ @override_settings(DEBUG=True)
+ def test_error_filter_still_raises(self):
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ 'error',
+ category=RemovedInNextVersionWarning
+ )
+ with self.assertRaises(RemovedInNextVersionWarning):
+ warnings.warn('Foo Deprecated', RemovedInNextVersionWarning)
+
class CallbackFilterTest(TestCase):
def test_sense(self):

0 comments on commit 8446a24

Please sign in to comment.