[pypy-commit] pypy py3.5: document why a test fail (didn't fix yet)

arigo pypy.commits at gmail.com
Thu Mar 9 09:44:52 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r90605:7c8b6de602ac
Date: 2017-03-09 15:44 +0100
http://bitbucket.org/pypy/pypy/changeset/7c8b6de602ac/

Log:	document why a test fail (didn't fix yet)

diff --git a/lib-python/3/test/test_io.py b/lib-python/3/test/test_io.py
--- a/lib-python/3/test/test_io.py
+++ b/lib-python/3/test/test_io.py
@@ -1169,7 +1169,12 @@
         b = bytearray(2*buffer_size)
         self.assertEqual(bufio.peek(3), b'fgh')
         self.assertEqual(rawio._reads, 3)
-        self.assertEqual(bufio.readinto1(b), 6)
+        self.assertEqual(bufio.readinto1(b), 6)  # fails because of
+        # an apparent inconsistency in CPython: readinto1(), if the
+        # buffered amount is smaller, would always issue one raw read()
+        # call.  This differs from read1(), which if the buffered amount
+        # if smaller (but more than zero), would just return it without
+        # any raw read() call.  In PyPy both have the behavior of read1().
         self.assertEqual(b[:6], b"fghjkl")
         self.assertEqual(rawio._reads, 4)
 


More information about the pypy-commit mailing list