Skip to content

Commit

Permalink
close the wrapped sockets to prevent Unraisable ResourceWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jun 8, 2021
1 parent e77ac03 commit 496dca6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_trustme.py
Expand Up @@ -258,6 +258,7 @@ def fake_ssl_client(ca, raw_client_sock, hostname):
# Send and receive some data to prove the connection is good
wrapped_client_sock.send(b"x")
assert wrapped_client_sock.recv(1) == b"y"
wrapped_client_sock.close()
except: # pragma: no cover
sys.excepthook(*sys.exc_info())
raise
Expand All @@ -271,6 +272,7 @@ def fake_ssl_server(server_cert, raw_server_sock):
# Prove that we're connected
assert wrapped_server_sock.recv(1) == b"x"
wrapped_server_sock.send(b"y")
wrapped_server_sock.close()
except: # pragma: no cover
sys.excepthook(*sys.exc_info())
raise
Expand Down

0 comments on commit 496dca6

Please sign in to comment.