summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2012-03-01 00:16:15 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2012-03-01 00:16:15 (GMT)
commite308b7c0c0e31e1c4d6f82365ea9f7a6e21ec6fb (patch)
tree5b6557e167ebab701b4e76b69c48535b105a5d2a
parentefb00c0cc189c1fdee329e8b7fdd07b3fd4a54cf (diff)
downloadcpython-e308b7c0c0e31e1c4d6f82365ea9f7a6e21ec6fb.zip
cpython-e308b7c0c0e31e1c4d6f82365ea9f7a6e21ec6fb.tar.gz
cpython-e308b7c0c0e31e1c4d6f82365ea9f7a6e21ec6fb.tar.bz2
also skip test_device_encoding when stdin isn't a tty
-rw-r--r--Lib/test/test_os.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 5959d1e..e0c59fd 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1433,8 +1433,8 @@ class DeviceEncodingTests(unittest.TestCase):
# Return None when an fd doesn't actually exist.
self.assertIsNone(os.device_encoding(123456))
- @unittest.skipUnless(sys.platform.startswith('win') or
- (hasattr(locale, 'nl_langinfo') and hasattr(locale, 'CODESET')),
+ @unittest.skipUnless(os.isatty(0) and (sys.platform.startswith('win') or
+ (hasattr(locale, 'nl_langinfo') and hasattr(locale, 'CODESET'))),
'test requires either Windows or nl_langinfo(CODESET)')
def test_device_encoding(self):
encoding = os.device_encoding(0)