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