mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
readline() args must be an int #3521
This commit is contained in:
parent
34596a90c8
commit
b01138a66e
2 changed files with 8 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue