Skip to content

Commit

Permalink
Change test class setup method to setup_class for pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed May 24, 2024
1 parent 92edc56 commit f8603f0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/test_capture_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))]
Expand All @@ -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()
Expand Down

0 comments on commit f8603f0

Please sign in to comment.