summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-10 21:04:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-10 21:04:47 (GMT)
commit927131e050950e7345b2f3e19e8a57c2a328385b (patch)
tree71f34b9b7d3990c3e063b7b9abb6bfe26af0a143 /Lib/test/test_warnings.py
parent649e1f141a839c0e90b8ebd940ab08eee62fcfad (diff)
parent60599525c509a962e8fb5897240d42a56c092961 (diff)
downloadcpython-927131e050950e7345b2f3e19e8a57c2a328385b.zip
cpython-927131e050950e7345b2f3e19e8a57c2a328385b.tar.gz
cpython-927131e050950e7345b2f3e19e8a57c2a328385b.tar.bz2
Issue #23016: A warning no longer produces an AttributeError when the program
is run with pythonw.exe.
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r--Lib/test/test_warnings.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 4776321..9ac2139 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -666,6 +666,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):