diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 22:49:15 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-25 22:49:15 +0200 |
commit | 988512cfd7c896dd8b900d0f00cba05c4c807dc3 (patch) | |
tree | 00d1050f4d082f25471ca7b9e61aa745e29a99c8 /Lib/test/test_io.py | |
parent | 4767114e77fc68cfcd630318ec58e632b00c2e04 (diff) | |
parent | a80987f20d0c73532127e1c3f69f7983c5c443d2 (diff) | |
download | cpython-git-988512cfd7c896dd8b900d0f00cba05c4c807dc3.tar.gz |
(Merge 3.1) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index a286c126c9..707b7cb088 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -827,14 +827,17 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): # Inject some None's in there to simulate EWOULDBLOCK rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None)) bufio = self.tp(rawio) - self.assertEqual(b"abcd", bufio.read(6)) self.assertEqual(b"e", bufio.read(1)) self.assertEqual(b"fg", bufio.read()) self.assertEqual(b"", bufio.peek(1)) - self.assertTrue(None is bufio.read()) + self.assertIsNone(bufio.read()) self.assertEqual(b"", bufio.read()) + rawio = self.MockRawIO((b"a", None, None)) + self.assertEqual(b"a", rawio.readall()) + self.assertIsNone(rawio.readall()) + def test_read_past_eof(self): rawio = self.MockRawIO((b"abc", b"d", b"efg")) bufio = self.tp(rawio) |