diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-01-15 22:40:03 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-01-15 22:40:03 (GMT) |
commit | 71ba215d6bcb1cc5394bcc711e93845cc979c9d5 (patch) | |
tree | e527ddb14e25f2fdd493bca7a720c4ca073c409b | |
parent | 51a035e383978ee0a529a35a7ecbde41c45ab99d (diff) | |
download | cpython-71ba215d6bcb1cc5394bcc711e93845cc979c9d5.zip cpython-71ba215d6bcb1cc5394bcc711e93845cc979c9d5.tar.gz cpython-71ba215d6bcb1cc5394bcc711e93845cc979c9d5.tar.bz2 |
Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor.
-rw-r--r-- | Lib/test/test_os.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 4702e7c..aa7b591 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -534,8 +534,10 @@ class Win32ErrorTests(unittest.TestCase): self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): - singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat", + singles = ["fchdir", "fdopen", "dup", "fdatasync", "fstat", "fstatvfs", "fsync", "tcgetpgrp", "ttyname"] + #singles.append("close") + #We omit close because it doesn'r raise an exception on some platforms def get_single(f): def helper(self): if getattr(os, f, None): @@ -565,9 +567,10 @@ class TestInvalidFD(unittest.TestCase): if hasattr(os, "fpathconf"): self.assertRaises(OSError, os.fpathconf, 10, "PC_FILESIZEBITS") + #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(OSError, os.ftruncate, 10, 0) + self.assertRaises(IOError, os.ftruncate, 10, 0) def test_lseek(self): self.assertRaises(OSError, os.lseek, 10, 0, 0) |