summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index a66726e..0bfa4d2 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -737,6 +737,11 @@ class IOTest(unittest.TestCase):
file.seek(0)
file.close()
self.assertRaises(ValueError, file.read)
+ with self.open(support.TESTFN, "rb") as f:
+ file = self.open(f.fileno(), "rb", closefd=False)
+ self.assertEqual(file.read()[:3], b"egg")
+ file.close()
+ self.assertRaises(ValueError, file.readinto, bytearray(1))
def test_no_closefd_with_filename(self):
# can't use closefd in combination with a file name