Skip to content

Commit

Permalink
Close custom TCP sockets
Browse files Browse the repository at this point in the history
This avoids ResourceWarnings from pytest when run under python -X dev.
  • Loading branch information
bmerry committed Aug 3, 2023
1 parent 341e6f4 commit 7bfbdb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,14 @@ def prepare_receiver(self, receiver):
self._port = sock.getsockname()[1]
sock.listen(1)
receiver.add_tcp_reader(sock)
sock.close()

def prepare_sender(self, thread_pool):
sock = socket.socket()
sock.connect(("127.0.0.1", self._port))
return spead2.send.TcpStream(thread_pool, sock)
sender = spead2.send.TcpStream(thread_pool, sock)
sock.close()
return sender


class TestPassthroughTcp6(BaseTestPassthrough):
Expand Down

0 comments on commit 7bfbdb0

Please sign in to comment.