File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,22 @@ def testModeStrings(self):
153
153
f .close ()
154
154
self .fail ('%r is an invalid file mode' % mode )
155
155
156
+ def testStdin (self ):
157
+ if sys .platform == 'osf1V5' :
158
+ # This causes the interpreter to exit on OSF1 v5.1.
159
+ self .skipTest (
160
+ ' sys.stdin.seek(-1) may crash the interpreter on OSF1.'
161
+ ' Test manually.' )
162
+
163
+ if not sys .stdin .isatty ():
164
+ # Issue 14853: stdin becomes seekable when redirected to a file
165
+ self .skipTest ('stdin must be a TTY in this test' )
166
+
167
+ with self .assertRaises ((IOError , ValueError )):
168
+ sys .stdin .seek (- 1 )
169
+ with self .assertRaises ((IOError , ValueError )):
170
+ sys .stdin .truncate ()
171
+
156
172
def testBadModeArgument (self ):
157
173
# verify that we get a sensible error message for bad mode argument
158
174
bad_mode = "qwerty"
You can’t perform that action at this time.
0 commit comments