mirror of
https://github.com/python/cpython.git
synced 2024-12-19 23:04:14 +08:00
Merge 3.5 (test_warnings)
This commit is contained in:
commit
b69d3fea88
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user