Commit 7ba8cdc3 authored by Victor Stinner's avatar Victor Stinner

Issue #23168: skip sys.stdin.seek() test if stdin is not a TTY

parent 6fcb9a51
...@@ -230,14 +230,20 @@ class OtherFileTests(unittest.TestCase): ...@@ -230,14 +230,20 @@ class OtherFileTests(unittest.TestCase):
else: else:
f.close() f.close()
def testStdin(self): def testStdinSeek(self):
# This causes the interpreter to exit on OSF1 v5.1. if sys.platform == 'osf1V5':
if sys.platform != 'osf1V5': # This causes the interpreter to exit on OSF1 v5.1.
self.assertRaises(IOError, sys.stdin.seek, -1) self.skipTest('Skipping sys.stdin.seek(-1), it may crash '
else: 'the interpreter. Test manually.')
print >>sys.__stdout__, (
' Skipping sys.stdin.seek(-1), it may crash the interpreter.' if not sys.stdin.isatty():
' Test manually.') # Issue #23168: if stdin is redirected to a file, stdin becomes
# seekable
self.skipTest('stdin must be a TTY in this test')
self.assertRaises(IOError, sys.stdin.seek, -1)
def testStdinTruncate(self):
self.assertRaises(IOError, sys.stdin.truncate) self.assertRaises(IOError, sys.stdin.truncate)
def testUnicodeOpen(self): def testUnicodeOpen(self):
......
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