[Python-checkins] cpython: also skip test_device_encoding when stdin isn't a tty

philip.jenvey python-checkins at python.org
Thu Mar 1 01:16:44 CET 2012


http://hg.python.org/cpython/rev/dd0638da6d51
changeset: 75354:dd0638da6d51
user: Philip Jenvey <pjenvey at underboss.org>
date: Wed Feb 29 16:16:15 2012 -0800
summary:
 also skip test_device_encoding when stdin isn't a tty
files:
 Lib/test/test_os.py | 4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1433,8 +1433,8 @@
 # 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)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /