Kaydet (Commit) 1121b5e6 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #25703: Skip test_43581 if one of stdout or stderr is redirected.

üst 8addf280
...@@ -412,7 +412,10 @@ class SysModuleTest(unittest.TestCase): ...@@ -412,7 +412,10 @@ class SysModuleTest(unittest.TestCase):
def test_43581(self): def test_43581(self):
# Can't use sys.stdout, as this is a cStringIO object when # Can't use sys.stdout, as this is a cStringIO object when
# the test runs under regrtest. # the test runs under regrtest.
self.assertTrue(sys.__stdout__.encoding == sys.__stderr__.encoding) if not (os.environ.get('PYTHONIOENCODING') or
(sys.__stdout__.isatty() and sys.__stderr__.isatty())):
self.skipTest('stdout/stderr encoding is not set')
self.assertEqual(sys.__stdout__.encoding, sys.__stderr__.encoding)
def test_sys_flags(self): def test_sys_flags(self):
self.assertTrue(sys.flags) self.assertTrue(sys.flags)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment