From: Christopher Frederickson Date: Thu, 21 Jun 2018 16:12:56 +0000 (-0400) Subject: bpo-33912: Fix test_warnings when run with -Werror (GH-7839) X-Git-Tag: v3.8.0a1~1514 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=419e88d18ccc83e182afca124d42f46794022aab;p=thirdparty%2FPython%2Fcpython.git bpo-33912: Fix test_warnings when run with -Werror (GH-7839) Add missing warning filter to test_exec_filename(). --- diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index 71f6a3003414..87f929f31478 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -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)