Tests: prevented writing non-chopped frames to the closed socket.

This commit is contained in:
Andrey Zelenkov
2019-09-02 14:55:00 +03:00
parent cb36616132
commit 70e808040d
2 changed files with 4 additions and 2 deletions

View File

@@ -173,7 +173,10 @@ class TestApplicationWebsocket(TestApplicationProto):
frame = self.frame_to_send(*args, **kwargs)
if chopsize is None:
sock.sendall(frame)
try:
sock.sendall(frame)
except BrokenPipeError:
pass
else:
pos = 0