summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 76a74fb..243fd5d 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -194,6 +194,10 @@ class PosixTester(unittest.TestCase):
self.fdopen_helper('r')
self.fdopen_helper('r', 100)
+ fd = os.open(test_support.TESTFN, os.O_RDONLY)
+ self.assertRaises(OSError, posix.fdopen, fd, 'w')
+ self.assertRaises(OSError, os.close, fd) # fd should be closed.
+
@unittest.skipUnless(hasattr(posix, 'O_EXLOCK'),
'test needs posix.O_EXLOCK')
def test_osexlock(self):