mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #21925: Fix test_warnings for release mode
Use -Wd comment line option to log the ResourceWarning.
This commit is contained in:
parent
a6d865c128
commit
6c45d397a3
1 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue