[pypy-svn] pypy default: Skip this test is stdin isn't a tty.

alex_gaynor commits-noreply at bitbucket.org
Sat Feb 12 05:58:24 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r41833:8f0b690981b4
Date: 2011-02-11 23:58 -0500
http://bitbucket.org/pypy/pypy/changeset/8f0b690981b4/

Log:	Skip this test is stdin isn't a tty.

diff --git a/lib-python/modified-2.7.0/test/test_file2k.py b/lib-python/modified-2.7.0/test/test_file2k.py
--- a/lib-python/modified-2.7.0/test/test_file2k.py
+++ b/lib-python/modified-2.7.0/test/test_file2k.py
@@ -221,7 +221,12 @@
     def testStdin(self):
         # This causes the interpreter to exit on OSF1 v5.1.
         if sys.platform != 'osf1V5':
-            self.assertRaises(IOError, sys.stdin.seek, -1)
+            if sys.stdin.isatty():
+                self.assertRaises(IOError, sys.stdin.seek, -1)
+            else:
+                print >>sys.__stdout__, (
+                    '  Skipping sys.stdin.seek(-1): stdin is not a tty.'
+                    ' Test manualy.')
         else:
             print >>sys.__stdout__, (
                 '  Skipping sys.stdin.seek(-1), it may crash the interpreter.'


More information about the Pypy-commit mailing list