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

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2018-06-04 10:23:41 -07:00 committed by GitHub
parent 1cdd0e71ec
commit d2c6ecc234
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,6 +221,8 @@ class FilterTests(BaseTest):
def test_module_globals(self):
with original_warnings.catch_warnings(record=True,
module=self.module) as w:
self.module.simplefilter("always", UserWarning)
# bpo-33509: module_globals=None must not crash
self.module.warn_explicit('msg', UserWarning, "filename", 42,
module_globals=None)