diff -r 9ac8df41dde7 Lib/test/test_asynchat.py --- a/Lib/test/test_asynchat.py Fri Jun 05 21:03:08 2015 -0500 +++ b/Lib/test/test_asynchat.py Sat Jun 06 15:31:36 2015 +0200 @@ -30,6 +30,7 @@ # This will be set if the client wants us to wait before echoing data # back. self.start_resend_event = None + self.received_len = 0 def run(self): self.sock.listen(1) @@ -41,6 +42,7 @@ data = conn.recv(1) if not data: break + self.received_len += len(data) self.buffer = self.buffer + data # remove the SERVER_QUIT message @@ -230,10 +232,7 @@ s.join() self.assertEqual(c.contents, []) - # the server might have been able to send a byte or two back, but this - # at least checks that it received something and didn't just fail - # (which could still result in the client not having received anything) - self.assertTrue(len(s.buffer) > 0) + self.assertTrue(s.received_len > 0) class TestAsynchat_WithPoll(TestAsynchat):