diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-10 20:59:55 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-10 20:59:55 (GMT) |
commit | 60599525c509a962e8fb5897240d42a56c092961 (patch) | |
tree | 6c28cb4857666bc60f52624015ae3d879e65751e /Lib/test/test_warnings.py | |
parent | 82c05a54a2ad92cd1d7bb391a62dec0d06bbc13a (diff) | |
download | cpython-60599525c509a962e8fb5897240d42a56c092961.zip cpython-60599525c509a962e8fb5897240d42a56c092961.tar.gz cpython-60599525c509a962e8fb5897240d42a56c092961.tar.bz2 |
Issue #23016: A warning no longer produces AttributeError when the program
is run with pythonw.exe.
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r-- | Lib/test/test_warnings.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py index 0f2e089..fb01b83 100644 --- a/Lib/test/test_warnings.py +++ b/Lib/test/test_warnings.py @@ -631,6 +631,15 @@ class _WarningsTests(BaseTest, unittest.TestCase): finally: globals_dict['__file__'] = oldfile + def test_stderr_none(self): + rc, stdout, stderr = assert_python_ok("-c", + "import sys; sys.stderr = None; " + "import warnings; warnings.simplefilter('always'); " + "warnings.warn('Warning!')") + self.assertEqual(stdout, b'') + self.assertNotIn(b'Warning!', stderr) + self.assertNotIn(b'Error', stderr) + class WarningsDisplayTests(BaseTest): |