[Python-checkins] r68622 - python/trunk/Lib/test/test_os.py
kristjan.jonsson
python-checkins at python.org
Thu Jan 15 23:46:27 CET 2009
Author: kristjan.jonsson
Date: Thu Jan 15 23:46:26 2009
New Revision: 68622
Log:
Make all the invalid fd tests for os subject to the function being available.
Modified:
python/trunk/Lib/test/test_os.py
Modified: python/trunk/Lib/test/test_os.py
==============================================================================
--- python/trunk/Lib/test/test_os.py (original)
+++ python/trunk/Lib/test/test_os.py Thu Jan 15 23:46:26 2009
@@ -547,13 +547,16 @@
locals()["test_"+f] = get_single(f)
def test_isatty(self):
- self.assertEqual(os.isatty(10), False)
+ if hasattr(os, "isatty"):
+ self.assertEqual(os.isatty(10), False)
def test_closerange(self):
- self.assertEqual(os.closerange(10, 20), None)
+ if hasattr(os, "closerange"):
+ self.assertEqual(os.closerange(10, 20), None)
def test_dup2(self):
- self.assertRaises(OSError, os.dup2, 10, 20)
+ if hasattr(os, "dup2"):
+ self.assertRaises(OSError, os.dup2, 10, 20)
def test_fchmod(self):
if hasattr(os, "fchmod"):
@@ -573,17 +576,20 @@
self.assertRaises(IOError, os.ftruncate, 10, 0)
def test_lseek(self):
- self.assertRaises(OSError, os.lseek, 10, 0, 0)
+ if hasattr(os, "lseek"):
+ self.assertRaises(OSError, os.lseek, 10, 0, 0)
def test_read(self):
- self.assertRaises(OSError, os.read, 10, 1)
+ if hasattr(os, "read"):
+ self.assertRaises(OSError, os.read, 10, 1)
def test_tcsetpgrpt(self):
if hasattr(os, "tcsetpgrp"):
self.assertRaises(OSError, os.tcsetpgrp, 10, 0)
def test_write(self):
- self.assertRaises(OSError, os.write, 10, " ")
+ if hasattr(os, "write"):
+ self.assertRaises(OSError, os.write, 10, " ")
if sys.platform != 'win32':
class Win32ErrorTests(unittest.TestCase):
More information about the Python-checkins
mailing list