summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-25 08:51:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-25 08:51:14 (GMT)
commit540a81c720fa5886f3f43a479424873a28a91512 (patch)
treeb10c3e79493fda196d1a0e5ce241a70e7ee168a7 /Lib
parent244e12088dfdb456c48acfcece584f3d55ad9c72 (diff)
downloadcpython-540a81c720fa5886f3f43a479424873a28a91512.zip
cpython-540a81c720fa5886f3f43a479424873a28a91512.tar.gz
cpython-540a81c720fa5886f3f43a479424873a28a91512.tar.bz2
Issue #21925: Fix test_warnings for release mode
Use -Wd comment line option to log the ResourceWarning.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_warnings/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py
index 633b2ac..fffadad 100644
--- a/Lib/test/test_warnings/__init__.py
+++ b/Lib/test/test_warnings/__init__.py
@@ -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))