]> granicus.if.org Git - python/commitdiff
Issue #21925: Fix test_warnings for release mode
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 25 Mar 2016 08:51:14 +0000 (09:51 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 25 Mar 2016 08:51:14 +0000 (09:51 +0100)
Use -Wd comment line option to log the ResourceWarning.

Lib/test/test_warnings/__init__.py

index 9f1cd7574f50f9fabe26f1493527bac52828b4a0..42c76035c3840225d4de328f880949463fb46d00 100644 (file)
@@ -1007,12 +1007,12 @@ a=A()
         # don't import the warnings module
         # (_warnings will try to import it)
         code = "f = open(%a)" % __file__
-        rc, out, err = assert_python_ok("-c", code)
+        rc, out, err = assert_python_ok("-Wd", "-c", code)
         self.assertTrue(err.startswith(expected), ascii(err))
 
         # import the warnings module
         code = "import warnings; f = open(%a)" % __file__
-        rc, out, err = assert_python_ok("-c", code)
+        rc, out, err = assert_python_ok("-Wd", "-c", code)
         self.assertTrue(err.startswith(expected), ascii(err))