]> granicus.if.org Git - python/commitdiff
bpo-33912: Fix test_warnings when run with -Werror (GH-7839)
authorChristopher Frederickson <fredericc0@students.rowan.edu>
Thu, 21 Jun 2018 16:12:56 +0000 (12:12 -0400)
committerVictor Stinner <vstinner@redhat.com>
Thu, 21 Jun 2018 16:12:56 +0000 (18:12 +0200)
Add missing warning filter to test_exec_filename().

Lib/test/test_warnings/__init__.py

index 71f6a3003414c33a1e6849bcc27d5a25300ac297..87f929f3147885c89a2220ef2e49381e821c9aca 100644 (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)