diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-05-26 13:22:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-05-26 13:22:14 (GMT) |
commit | b69d3fea8828d709c6e6f4df4beb6b56874f69bd (patch) | |
tree | c0689556efcb1c31dfa798a64b4e7e3da7b9fd4e /Lib/test/test_warnings | |
parent | b6ae2ae47ca754aed313e84990f220777cf45905 (diff) | |
parent | 0025eb145fb4e66c9faad696a0e1033d0a1c3375 (diff) | |
download | cpython-b69d3fea8828d709c6e6f4df4beb6b56874f69bd.zip cpython-b69d3fea8828d709c6e6f4df4beb6b56874f69bd.tar.gz cpython-b69d3fea8828d709c6e6f4df4beb6b56874f69bd.tar.bz2 |
Merge 3.5 (test_warnings)
Diffstat (limited to 'Lib/test/test_warnings')
-rw-r--r-- | Lib/test/test_warnings/__init__.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index 3c52b29..497c5cc 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -106,7 +106,15 @@ class FilterTests(BaseTest): message = "FilterTests.test_ignore_after_default" def f(): self.module.warn(message, UserWarning) - f() + + with support.captured_stderr() as stderr: + f() + stderr = stderr.getvalue() + self.assertIn("UserWarning: FilterTests.test_ignore_after_default", + stderr) + self.assertIn("self.module.warn(message, UserWarning)", + stderr) + self.module.filterwarnings("error", category=UserWarning) self.assertRaises(UserWarning, f) |