[Python-checkins] cpython (merge 3.6 -> default): Issue #20254: Merge from 3.6
berker.peksag
python-checkins at python.org
Sun Oct 2 04:38:16 EDT 2016
https://hg.python.org/cpython/rev/7dab3c6ac42f
changeset: 104241:7dab3c6ac42f
parent: 104238:6f299f7d6643
parent: 104240:ac9734540eb7
user: Berker Peksag <berker.peksag at gmail.com>
date: Sun Oct 02 11:40:30 2016 +0300
summary:
Issue #20254: Merge from 3.6
files:
Lib/test/test_socket.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4668,9 +4668,10 @@
SocketConnectedTest.__init__(self, methodName=methodName)
def testRecvIntoArray(self):
- buf = bytearray(1024)
+ buf = array.array("B", [0] * len(MSG))
nbytes = self.cli_conn.recv_into(buf)
self.assertEqual(nbytes, len(MSG))
+ buf = buf.tobytes()
msg = buf[:len(MSG)]
self.assertEqual(msg, MSG)
@@ -4697,9 +4698,10 @@
_testRecvIntoMemoryview = _testRecvIntoArray
def testRecvFromIntoArray(self):
- buf = bytearray(1024)
+ buf = array.array("B", [0] * len(MSG))
nbytes, addr = self.cli_conn.recvfrom_into(buf)
self.assertEqual(nbytes, len(MSG))
+ buf = buf.tobytes()
msg = buf[:len(MSG)]
self.assertEqual(msg, MSG)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list