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

Add missing warning filter to test_exec_filename().
This commit is contained in:
Christopher Frederickson 2018-06-21 12:12:56 -04:00 committed by Victor Stinner
parent 3ad8decd76
commit 419e88d18c
1 changed files with 1 additions and 0 deletions

View File

@ -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)