From 7d71e604baf6feaca3bf30c21bcef66f1cf28a8b Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Fri, 24 May 2024 13:32:40 -0400 Subject: [PATCH] Change test class setup method to setup_class for pytest --- test/test_capture_http_proxy.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/test_capture_http_proxy.py b/test/test_capture_http_proxy.py index 4c59f7ab..fb8e6f69 100644 --- a/test/test_capture_http_proxy.py +++ b/test/test_capture_http_proxy.py @@ -14,7 +14,7 @@ # ================================================================== class TestCaptureHttpProxy(): - def setup(cls): + def setup_class(cls): def app(env, start_response): result = ('Proxied: ' + env['PATH_INFO']).encode('utf-8') headers = [('Content-Length', str(len(result)))] @@ -31,15 +31,11 @@ def handle_error(self, request, client_address): server = make_server('localhost', 0, wsgiprox, server_class=NoLogServer) addr, cls.port = server.socket.getsockname() - print(f"cls.port: {cls.port}", flush=True) - cls.proxies = { 'https': 'http://proxy.com:' + str(cls.port), 'http': 'http://proxy.com:' + str(cls.port) } - print(f"cls.proxies: {cls.proxies}", flush=True) - def run(): try: server.serve_forever()