Skip to content

Commit d2c6ecc

Browse files
bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
Fix test_warnings.test_module_globals() when python3 is run with -Werror. (cherry picked from commit e292b75) Co-authored-by: Victor Stinner <[email protected]>
1 parent 1cdd0e7 commit d2c6ecc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_warnings/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ def test_once(self):
221221
def test_module_globals(self):
222222
with original_warnings.catch_warnings(record=True,
223223
module=self.module) as w:
224+
self.module.simplefilter("always", UserWarning)
225+
224226
# bpo-33509: module_globals=None must not crash
225227
self.module.warn_explicit('msg', UserWarning, "filename", 42,
226228
module_globals=None)

0 commit comments

Comments
 (0)