Commit 419e88d1 authored by Christopher Frederickson's avatar Christopher Frederickson Committed by Victor Stinner

bpo-33912: Fix test_warnings when run with -Werror (GH-7839)

Add missing warning filter to test_exec_filename().
parent 3ad8decd
......@@ -447,6 +447,7 @@ class WarnTests(BaseTest):
"warnings.warn('hello', UserWarning)"),
filename, "exec")
with original_warnings.catch_warnings(record=True) as w:
self.module.simplefilter("always", category=UserWarning)
exec(codeobj)
self.assertEqual(w[0].filename, filename)
......
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