aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-04-03 09:54:29 +1200
committerAldo Cortesi <aldo@corte.si>2018-04-03 10:26:09 +1200
commit659fceb697054d28e427c3a1169e07c210049159 (patch)
treedbd08831bf16292f2db6794662282fcb5734957d /test
parent7e73e5fa51fb59ee1937bd8f634834bb420ff903 (diff)
downloadmitmproxy-659fceb697054d28e427c3a1169e07c210049159.tar.gz
mitmproxy-659fceb697054d28e427c3a1169e07c210049159.tar.bz2
mitmproxy-659fceb697054d28e427c3a1169e07c210049159.zip
minor fixes
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/proxy/protocol/test_http2.py1
-rw-r--r--test/mitmproxy/tservers.py13
2 files changed, 4 insertions, 10 deletions
diff --git a/test/mitmproxy/proxy/protocol/test_http2.py b/test/mitmproxy/proxy/protocol/test_http2.py
index 58114904..13f28728 100644
--- a/test/mitmproxy/proxy/protocol/test_http2.py
+++ b/test/mitmproxy/proxy/protocol/test_http2.py
@@ -6,7 +6,6 @@ import tempfile
import traceback
import pytest
import h2
-import time
from mitmproxy import options
diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py
index 7feb90b7..2d102a5d 100644
--- a/test/mitmproxy/tservers.py
+++ b/test/mitmproxy/tservers.py
@@ -14,6 +14,7 @@ from mitmproxy import controller
from mitmproxy import options
from mitmproxy import exceptions
from mitmproxy import io
+from mitmproxy.utils import human
import pathod.test
import pathod.pathoc
@@ -111,10 +112,7 @@ class ProxyThread(threading.Thread):
asyncio.set_event_loop(self.event_loop)
self.tmaster = self.masterclass(self.options)
self.tmaster.addons.add(core.Core())
- self.name = "ProxyThread (%s:%s)" % (
- self.tmaster.server.address[0],
- self.tmaster.server.address[1],
- )
+ self.name = "ProxyThread (%s)" % human.format_address(self.tmaster.server.address)
self.tmaster.run()
def set_addons(self, *addons):
@@ -362,11 +360,8 @@ class HTTPUpstreamProxyTest(HTTPProxyTest):
proxy = ProxyThread(cls.masterclass, opts)
proxy.start()
cls.chain.insert(0, proxy)
- while 1:
- if(
- proxy.event_loop and
- proxy.event_loop.is_running()
- ):
+ while True:
+ if proxy.event_loop and proxy.event_loop.is_running():
break
super().setup_class()