changeset: 100738:f474898ef6de branch: 3.5 user: Victor Stinner date: Fri Mar 25 09:51:14 2016 +0100 files: Lib/test/test_warnings/__init__.py description: Issue #21925: Fix test_warnings for release mode Use -Wd comment line option to log the ResourceWarning. diff -r b1666037c97e -r f474898ef6de Lib/test/test_warnings/__init__.py --- a/Lib/test/test_warnings/__init__.py Fri Jan 22 14:09:55 2016 +0100 +++ b/Lib/test/test_warnings/__init__.py Fri Mar 25 09:51:14 2016 +0100 @@ -962,12 +962,12 @@ # 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))