diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-04-24 22:59:52 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-04-24 22:59:52 (GMT) |
commit | b01138a66ec36104079987fdd12155716bda3686 (patch) | |
tree | 37c38246a0db7f83f89b7926724b2a58a41eb481 /Lib/test/test_io.py | |
parent | 34596a90c8ff860e989df52c818340266afa740a (diff) | |
download | cpython-b01138a66ec36104079987fdd12155716bda3686.zip cpython-b01138a66ec36104079987fdd12155716bda3686.tar.gz cpython-b01138a66ec36104079987fdd12155716bda3686.tar.bz2 |
readline() args must be an int #3521
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 439af7a..7459714 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -319,7 +319,7 @@ class IOTest(unittest.TestCase): f.close() def test_readline(self): - f = io.open(support.TESTFN, "wb") + f = self.open(support.TESTFN, "wb") f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line") f.close() f = self.open(support.TESTFN, "rb") @@ -329,7 +329,10 @@ class IOTest(unittest.TestCase): self.assertEqual(f.readline(4), b"zzy\n") self.assertEqual(f.readline(), b"foo\x00bar\n") self.assertEqual(f.readline(), b"another line") + self.assertRaises(TypeError, f.readline, 5.3) f.close() + f = self.open(support.TESTFN, "r") + self.assertRaises(TypeError, f.readline, 5.3) def test_raw_bytes_io(self): f = self.BytesIO() |