Commit b69d3fea authored by Victor Stinner's avatar Victor Stinner

Merge 3.5 (test_warnings)

parents b6ae2ae4 0025eb14
...@@ -106,7 +106,15 @@ class FilterTests(BaseTest): ...@@ -106,7 +106,15 @@ class FilterTests(BaseTest):
message = "FilterTests.test_ignore_after_default" message = "FilterTests.test_ignore_after_default"
def f(): def f():
self.module.warn(message, UserWarning) 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.module.filterwarnings("error", category=UserWarning)
self.assertRaises(UserWarning, f) self.assertRaises(UserWarning, f)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment