]> granicus.if.org Git - python/commitdiff
Fix test_file.py. It was passing on OSX for the wrong reason
authorGuido van Rossum <guido@python.org>
Tue, 10 Jul 2007 20:59:22 +0000 (20:59 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 10 Jul 2007 20:59:22 +0000 (20:59 +0000)
(somehow OSX marks I/O devices as seekable).

Lib/test/test_file.py

index 076400015c3366e3514d0f91ab1d373bfa7e8ca1..62b4693c2352d271c63570cc4558eb568cb1a2b7 100644 (file)
@@ -140,12 +140,12 @@ class OtherFileTests(unittest.TestCase):
     def testStdin(self):
         # This causes the interpreter to exit on OSF1 v5.1.
         if sys.platform != 'osf1V5':
-            self.assertRaises(ValueError, sys.stdin.seek, -1)
+            self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
         else:
             print((
                 '  Skipping sys.stdin.seek(-1), it may crash the interpreter.'
                 ' Test manually.'), file=sys.__stdout__)
-        self.assertRaises(ValueError, sys.stdin.truncate)
+        self.assertRaises((IOError, ValueError), sys.stdin.truncate)
 
     def testBadModeArgument(self):
         # verify that we get a sensible error message for bad mode argument