From e6e4055f81dbbece55dccfe29b7fb82b9bf40610 Mon Sep 17 00:00:00 2001 From: sturmianseq <88301801+sturmianseq@users.noreply.github.com> Date: Mon, 27 Dec 2021 20:18:25 +0800 Subject: [PATCH] Restore original socket after test execution of test_check_connect (#19) --- tests/test_request.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_request.py b/tests/test_request.py index 1877d56..4616338 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -50,8 +50,10 @@ def test_check_connect(port=None): def mock_socket(*args): raise socket.error + old_socket = pydu.request.socket.socket pydu.request.socket.socket = mock_socket assert not check_connect('127.0.0.1', port=port, timeout=0.01) + pydu.request.socket.socket = old_socket def test_update_query_params():