mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
bpo-33912: Fix test_warnings when run with -Werror (GH-7839)
Add missing warning filter to test_exec_filename().
This commit is contained in:
parent
3ad8decd76
commit
419e88d18c
1 changed files with 1 additions and 0 deletions
|
@ -447,6 +447,7 @@ class WarnTests(BaseTest):
|
||||||
"warnings.warn('hello', UserWarning)"),
|
"warnings.warn('hello', UserWarning)"),
|
||||||
filename, "exec")
|
filename, "exec")
|
||||||
with original_warnings.catch_warnings(record=True) as w:
|
with original_warnings.catch_warnings(record=True) as w:
|
||||||
|
self.module.simplefilter("always", category=UserWarning)
|
||||||
exec(codeobj)
|
exec(codeobj)
|
||||||
self.assertEqual(w[0].filename, filename)
|
self.assertEqual(w[0].filename, filename)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue