Skip to content
Myr

Close socket properly in test_server_closes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Braulio Valdivielso Martínez · committed by Braulio Valdivielso Martínez · parent b4b4661 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:test_requests.py+1 added-1 removed
1758 unmodified lines
1759 def test_server_closes(self):1760 with Server.basic_response_server() as (host, port):1761 sock = socket.socket()1762 sock.connect((host, port))1763 sock.close()17641765 with pytest.raises(socket.error):1766 new_sock = socket.socket()1767 new_sock.connect((host, port))1767 sock.close()1768 1769 def test_basic_response(self):1770 with Server.basic_response_server() as (host, port):1771 r = requests.get('http://{}:{}'.format(host, port))
6 unmodified lines