Skip to content

Commit

Permalink
Added test about error filterwarnings
Browse files Browse the repository at this point in the history
Refs #20083.
  • Loading branch information
claudep committed Mar 8, 2014
1 parent 0c6a339 commit 8446a24
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/logging_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8446a24

Please sign in to comment.