diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/proxy/protocol/test_http2.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/proxy/protocol/test_websocket.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/tservers.py | 11 |
3 files changed, 7 insertions, 12 deletions
diff --git a/test/mitmproxy/proxy/protocol/test_http2.py b/test/mitmproxy/proxy/protocol/test_http2.py index 1cc36402..58114904 100644 --- a/test/mitmproxy/proxy/protocol/test_http2.py +++ b/test/mitmproxy/proxy/protocol/test_http2.py @@ -92,10 +92,6 @@ class _Http2TestBase: cls.options = cls.get_options() cls.proxy = tservers.ProxyThread(tservers.TestMaster, cls.options) cls.proxy.start() - while True: - if cls.proxy.tmaster: - break - time.sleep(0.01) @classmethod def teardown_class(cls): diff --git a/test/mitmproxy/proxy/protocol/test_websocket.py b/test/mitmproxy/proxy/protocol/test_websocket.py index f64f500c..e5ed8e9d 100644 --- a/test/mitmproxy/proxy/protocol/test_websocket.py +++ b/test/mitmproxy/proxy/protocol/test_websocket.py @@ -54,10 +54,6 @@ class _WebSocketTestBase: cls.options = cls.get_options() cls.proxy = tservers.ProxyThread(tservers.TestMaster, cls.options) cls.proxy.start() - while True: - if cls.proxy.tmaster: - break - time.sleep(0.01) @classmethod def teardown_class(cls): diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py index d72ca138..7feb90b7 100644 --- a/test/mitmproxy/tservers.py +++ b/test/mitmproxy/tservers.py @@ -121,6 +121,13 @@ class ProxyThread(threading.Thread): self.tmaster.reset(addons) self.tmaster.addons.trigger("tick") + def start(self): + super().start() + while True: + if self.tmaster: + break + time.sleep(0.01) + class ProxyTestBase: # Test Configuration @@ -142,10 +149,6 @@ class ProxyTestBase: cls.options = cls.get_options() cls.proxy = ProxyThread(cls.masterclass, cls.options) cls.proxy.start() - while True: - if cls.proxy.tmaster: - break - time.sleep(0.01) @classmethod def teardown_class(cls): |