Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 540a81c

Browse files
committed
Issue #21925: Fix test_warnings for release mode
Use -Wd comment line option to log the ResourceWarning.
1 parent 244e120 commit 540a81c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_warnings/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,12 +962,12 @@ def test_late_resource_warning(self):
962962
# don't import the warnings module
963963
# (_warnings will try to import it)
964964
code = "f = open(%a)" % __file__
965-
rc, out, err = assert_python_ok("-c", code)
965+
rc, out, err = assert_python_ok("-Wd", "-c", code)
966966
self.assertTrue(err.startswith(expected), ascii(err))
967967

968968
# import the warnings module
969969
code = "import warnings; f = open(%a)" % __file__
970-
rc, out, err = assert_python_ok("-c", code)
970+
rc, out, err = assert_python_ok("-Wd", "-c", code)
971971
self.assertTrue(err.startswith(expected), ascii(err))
972972

973973

0 commit comments

Comments
 (0)