summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:52:37 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 20:52:37 (GMT)
commitdaf17e9bc8aa4aae570d9746a724ba5f3fdc7cb9 (patch)
tree95d10cf2f029b0e2bdccd9bbd8fcf6193c739e6b /Lib/test/test_io.py
parent5100a405dc6abe7f28597248b3dea415c2089d4a (diff)
downloadcpython-daf17e9bc8aa4aae570d9746a724ba5f3fdc7cb9.zip
cpython-daf17e9bc8aa4aae570d9746a724ba5f3fdc7cb9.tar.gz
cpython-daf17e9bc8aa4aae570d9746a724ba5f3fdc7cb9.tar.bz2
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.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 9b18b70..d0608e3 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -798,14 +798,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)