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 633b2ac9f6130a87572ba56ecfe013801db06d3b..fffadad7805c76a8d970d3a39211c4d1d5652610 100644 (file)
@@ -962,12 +962,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))