From bed9e520a371a99132e05511f110a141d22d2a7f Mon Sep 17 00:00:00 2001 From: Samuel Fekete Date: Mon, 3 Jul 2017 15:29:36 +0100 Subject: [PATCH] Fix `socketserver` for Python 3 --- tests/integration/test_proxy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_proxy.py b/tests/integration/test_proxy.py index ce67e60..ab104b1 100644 --- a/tests/integration/test_proxy.py +++ b/tests/integration/test_proxy.py @@ -3,11 +3,10 @@ # External imports import multiprocessing -import SocketServer -import SimpleHTTPServer import pytest requests = pytest.importorskip("requests") +from six.moves import socketserver, SimpleHTTPServer from six.moves.urllib.request import urlopen # Internal imports @@ -26,7 +25,7 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): @pytest.yield_fixture(scope='session') def proxy_server(httpbin): - httpd = SocketServer.ForkingTCPServer(('', 0), Proxy) + httpd = socketserver.ForkingTCPServer(('', 0), Proxy) proxy_process = multiprocessing.Process( target=httpd.serve_forever, )