Commit bd05938f authored by Victor Stinner's avatar Victor Stinner

Issue #21925: Fix test_warnings for release mode

Use -Wd comment line option to log the ResourceWarning.
parent 162de05b
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment