aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-01-27 10:12:18 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-01-27 10:36:28 +0100
commit8c375383148f100f03aed52827ac513f145078c2 (patch)
treedbae3b5d4d603e5e226477f1938119e2acfcfc1f /test
parentc2bb29f669cd80509f4efe205551a9cf5fc29770 (diff)
downloadmitmproxy-8c375383148f100f03aed52827ac513f145078c2.tar.gz
mitmproxy-8c375383148f100f03aed52827ac513f145078c2.tar.bz2
mitmproxy-8c375383148f100f03aed52827ac513f145078c2.zip
code formatting: fix whitespace issues
Diffstat (limited to 'test')
-rw-r--r--test/scripts/a_helper.py2
-rw-r--r--test/scripts/tcp_stream_modify.py2
-rw-r--r--test/scripts/unloaderr.py2
-rw-r--r--test/test_app.py1
-rw-r--r--test/test_console.py1
-rw-r--r--test/test_console_help.py3
-rw-r--r--test/test_console_palettes.py1
-rw-r--r--test/test_console_pathedit.py1
-rw-r--r--test/test_controller.py1
-rw-r--r--test/test_custom_contentview.py3
-rw-r--r--test/test_dump.py2
-rw-r--r--test/test_filt.py2
-rw-r--r--test/test_flow.py14
-rw-r--r--test/test_flow_format_compat.py2
-rw-r--r--test/test_fuzzing.py1
-rw-r--r--test/test_platform_pf.py1
-rw-r--r--test/test_protocol_http.py6
-rw-r--r--test/test_proxy.py4
-rw-r--r--test/test_script.py2
-rw-r--r--test/test_server.py42
-rw-r--r--test/tools/benchtool.py1
-rw-r--r--test/tools/inspect_dumpfile.py1
-rw-r--r--test/tools/memoryleak.py4
-rw-r--r--test/tools/passive_close.py1
-rw-r--r--test/tservers.py7
-rw-r--r--test/tutils.py1
26 files changed, 82 insertions, 26 deletions
diff --git a/test/scripts/a_helper.py b/test/scripts/a_helper.py
index 2eeed0d4..e1f1c649 100644
--- a/test/scripts/a_helper.py
+++ b/test/scripts/a_helper.py
@@ -1,4 +1,4 @@
import argparse
parser = argparse.ArgumentParser()
-parser.add_argument('--var', type=int) \ No newline at end of file
+parser.add_argument('--var', type=int)
diff --git a/test/scripts/tcp_stream_modify.py b/test/scripts/tcp_stream_modify.py
index 9870dddf..93b0d5c8 100644
--- a/test/scripts/tcp_stream_modify.py
+++ b/test/scripts/tcp_stream_modify.py
@@ -1,3 +1,3 @@
-def tcp_message(ctx,tm):
+def tcp_message(ctx, tm):
if tm.sender == tm.server_conn:
tm.message = tm.message.replace("foo", "bar")
diff --git a/test/scripts/unloaderr.py b/test/scripts/unloaderr.py
index f3743107..fba02734 100644
--- a/test/scripts/unloaderr.py
+++ b/test/scripts/unloaderr.py
@@ -1,2 +1,2 @@
def done(ctx):
- raise RuntimeError() \ No newline at end of file
+ raise RuntimeError()
diff --git a/test/test_app.py b/test/test_app.py
index f412072a..8872bf53 100644
--- a/test/test_app.py
+++ b/test/test_app.py
@@ -3,6 +3,7 @@ import tservers
class TestApp(tservers.HTTPProxTest):
+
def test_basic(self):
assert self.app("/").status_code == 200
diff --git a/test/test_console.py b/test/test_console.py
index 9d1f8113..a807d381 100644
--- a/test/test_console.py
+++ b/test/test_console.py
@@ -8,6 +8,7 @@ import tutils
class TestConsoleState:
+
def test_flow(self):
"""
normal flow:
diff --git a/test/test_console_help.py b/test/test_console_help.py
index dc2591e5..32d94247 100644
--- a/test/test_console_help.py
+++ b/test/test_console_help.py
@@ -7,11 +7,13 @@ import libmproxy.console.help as help
class DummyLoop:
+
def __init__(self):
self.widget = None
class DummyMaster:
+
def __init__(self):
self.loop = DummyLoop()
@@ -20,6 +22,7 @@ class DummyMaster:
class TestHelp:
+
def test_helptext(self):
h = help.HelpView(None)
assert h.helptext()
diff --git a/test/test_console_palettes.py b/test/test_console_palettes.py
index 9cf5d95c..ac33f83d 100644
--- a/test/test_console_palettes.py
+++ b/test/test_console_palettes.py
@@ -6,6 +6,7 @@ import libmproxy.console.palettes as palettes
class TestPalette:
+
def test_helptext(self):
for i in palettes.palettes.values():
assert i.palette(False)
diff --git a/test/test_console_pathedit.py b/test/test_console_pathedit.py
index 605e1e2f..43212bc8 100644
--- a/test/test_console_pathedit.py
+++ b/test/test_console_pathedit.py
@@ -6,6 +6,7 @@ import tutils
class TestPathCompleter:
+
def test_lookup_construction(self):
c = pathedit._PathCompleter()
diff --git a/test/test_controller.py b/test/test_controller.py
index d287f18d..ffc7d433 100644
--- a/test/test_controller.py
+++ b/test/test_controller.py
@@ -3,6 +3,7 @@ from libmproxy import controller
class TestMaster:
+
def test_default_handler(self):
m = controller.Master(None)
msg = mock.MagicMock()
diff --git a/test/test_custom_contentview.py b/test/test_custom_contentview.py
index 2538ab35..adc4109b 100644
--- a/test/test_custom_contentview.py
+++ b/test/test_custom_contentview.py
@@ -11,7 +11,6 @@ def test_custom_views():
def __call__(self, data, **metadata):
return "noop", cv.format_text(data)
-
view_obj = ViewNoop()
cv.add(view_obj)
@@ -47,5 +46,3 @@ def test_custom_views():
)
)
assert "noop" not in r[0]
-
-
diff --git a/test/test_dump.py b/test/test_dump.py
index a903a651..11048347 100644
--- a/test/test_dump.py
+++ b/test/test_dump.py
@@ -43,7 +43,6 @@ def test_strfuncs():
flow.response.status_code = 300
m.echo_flow(flow)
-
flow = tutils.tflow(resp=netlib.tutils.tresp(content="{"))
flow.response.headers["content-type"] = "application/json"
flow.response.status_code = 400
@@ -61,6 +60,7 @@ def test_contentview(get_content_view):
class TestDumpMaster:
+
def _cycle(self, m, content):
f = tutils.tflow(req=netlib.tutils.treq(content=content))
l = Log("connect")
diff --git a/test/test_filt.py b/test/test_filt.py
index c9b8937e..4671a273 100644
--- a/test/test_filt.py
+++ b/test/test_filt.py
@@ -7,6 +7,7 @@ import tutils
class TestParsing:
+
def _dump(self, x):
c = cStringIO.StringIO()
x.dump(fp=c)
@@ -75,6 +76,7 @@ class TestParsing:
class TestMatching:
+
def req(self):
headers = Headers(header="qvalue")
req = http.HTTPRequest(
diff --git a/test/test_flow.py b/test/test_flow.py
index 388182f9..9775c72f 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -43,6 +43,7 @@ def test_app_registry():
class TestStickyCookieState:
+
def _response(self, cookie, host):
s = flow.StickyCookieState(filt.parse(".*"))
f = tutils.tflow(req=netlib.tutils.treq(host=host, port=80), resp=True)
@@ -76,6 +77,7 @@ class TestStickyCookieState:
class TestStickyAuthState:
+
def test_handle_response(self):
s = flow.StickyAuthState(filt.parse(".*"))
f = tutils.tflow(resp=True)
@@ -89,6 +91,7 @@ class TestStickyAuthState:
class TestClientPlaybackState:
+
def test_tick(self):
first = tutils.tflow()
s = flow.State()
@@ -122,6 +125,7 @@ class TestClientPlaybackState:
class TestServerPlaybackState:
+
def test_hash(self):
s = flow.ServerPlaybackState(
None,
@@ -343,6 +347,7 @@ class TestServerPlaybackState:
class TestFlow(object):
+
def test_copy(self):
f = tutils.tflow(resp=True)
a0 = f.get_state()
@@ -492,6 +497,7 @@ class TestFlow(object):
class TestState:
+
def test_backup(self):
c = flow.State()
f = tutils.tflow()
@@ -629,6 +635,7 @@ class TestState:
class TestSerialize:
+
def _treader(self):
sio = StringIO()
w = flow.FlowWriter(sio)
@@ -716,6 +723,7 @@ class TestSerialize:
class TestFlowMaster:
+
def test_load_script(self):
s = flow.State()
fm = flow.FlowMaster(None, s)
@@ -995,6 +1003,7 @@ class TestFlowMaster:
class TestRequest:
+
def test_simple(self):
f = tutils.tflow()
r = f.request
@@ -1113,7 +1122,7 @@ class TestRequest:
r = HTTPRequest.wrap(netlib.tutils.treq())
r.content = None
r.headers["content-encoding"] = "identity"
- assert r.get_decoded_content() == None
+ assert r.get_decoded_content() is None
r.content = "falafel"
r.encode("gzip")
@@ -1126,6 +1135,7 @@ class TestRequest:
class TestResponse:
+
def test_simple(self):
f = tutils.tflow(resp=True)
resp = f.response
@@ -1179,6 +1189,7 @@ class TestResponse:
class TestError:
+
def test_getset_state(self):
e = Error("Error")
state = e.get_state()
@@ -1196,6 +1207,7 @@ class TestError:
class TestClientConnection:
+
def test_state(self):
c = tutils.tclient_conn()
diff --git a/test/test_flow_format_compat.py b/test/test_flow_format_compat.py
index 1073e298..d64b75e7 100644
--- a/test/test_flow_format_compat.py
+++ b/test/test_flow_format_compat.py
@@ -14,4 +14,4 @@ def test_cannot_convert():
with open(tutils.test_data.path("data/dumpfile-012"), "rb") as f:
flow_reader = FlowReader(f)
with tutils.raises(FlowReadError):
- list(flow_reader.stream()) \ No newline at end of file
+ list(flow_reader.stream())
diff --git a/test/test_fuzzing.py b/test/test_fuzzing.py
index eff8c573..c1527aa2 100644
--- a/test/test_fuzzing.py
+++ b/test/test_fuzzing.py
@@ -7,6 +7,7 @@ import tservers
class TestFuzzy(tservers.HTTPProxTest):
+
def test_idna_err(self):
req = r'get:"http://localhost:%s":i10,"\xc6"'
p = self.pathoc()
diff --git a/test/test_platform_pf.py b/test/test_platform_pf.py
index 3250b035..d8718c8f 100644
--- a/test/test_platform_pf.py
+++ b/test/test_platform_pf.py
@@ -4,6 +4,7 @@ from libmproxy.platform import pf
class TestLookup:
+
def test_simple(self):
if sys.platform == "freebsd10":
p = tutils.test_data.path("data/pf02")
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py
index c7c5c1b6..59ba6b15 100644
--- a/test/test_protocol_http.py
+++ b/test/test_protocol_http.py
@@ -8,6 +8,7 @@ import tservers
class TestHTTPResponse:
+
def test_read_from_stringio(self):
s = (
b"HTTP/1.1 200 OK\r\n"
@@ -34,6 +35,7 @@ class TestHTTPResponse:
class TestHTTPFlow(object):
+
def test_repr(self):
f = tutils.tflow(resp=True, err=True)
assert repr(f)
@@ -57,6 +59,7 @@ class TestInvalidRequests(tservers.HTTPProxTest):
class TestExpectHeader(tservers.HTTPProxTest):
+
def test_simple(self):
client = TCPClient(("127.0.0.1", self.proxy.port))
client.connect()
@@ -83,7 +86,8 @@ class TestExpectHeader(tservers.HTTPProxTest):
class TestHeadContentLength(tservers.HTTPProxTest):
+
def test_head_content_length(self):
p = self.pathoc()
resp = p.request("""head:'%s/p/200:h"Content-Length"="42"'""" % self.server.urlbase)
- assert resp.headers["Content-Length"] == "42" \ No newline at end of file
+ assert resp.headers["Content-Length"] == "42"
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 1759f07a..f4ce6135 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -54,6 +54,7 @@ class TestServerConnection(object):
class TestProcessProxyOptions:
+
def p(self, *args):
parser = tutils.MockParser()
cmdline.common_options(parser)
@@ -151,6 +152,7 @@ class TestProcessProxyOptions:
class TestProxyServer:
# binding to 0.0.0.0:1 works without special permissions on Windows
+
@tutils.skip_windows
def test_err(self):
conf = ProxyConfig(
@@ -166,6 +168,7 @@ class TestProxyServer:
class TestDummyServer:
+
def test_simple(self):
d = DummyServer(None)
d.start_slave()
@@ -173,6 +176,7 @@ class TestDummyServer:
class TestConnectionHandler:
+
def test_fatal_error(self):
config = mock.Mock()
root_layer = mock.Mock()
diff --git a/test/test_script.py b/test/test_script.py
index b2bb33b9..11b1a64d 100644
--- a/test/test_script.py
+++ b/test/test_script.py
@@ -91,6 +91,7 @@ def test_concurrent2():
m = mock.Mock()
class Dummy:
+
def __init__(self):
self.response = self
self.error = self
@@ -129,4 +130,3 @@ def test_command_parsing():
absfilepath = os.path.normcase(tutils.test_data.path("scripts/a.py"))
s = script.Script(absfilepath, script.ScriptContext(fm))
assert os.path.isfile(s.args[0])
-
diff --git a/test/test_server.py b/test/test_server.py
index 2e21fce7..9a3200aa 100644
--- a/test/test_server.py
+++ b/test/test_server.py
@@ -29,6 +29,7 @@ import tservers
class CommonMixin:
+
def test_large(self):
assert len(self.pathod("200:b@50k").content) == 1024 * 50
@@ -107,6 +108,7 @@ class CommonMixin:
class TcpMixin:
+
def _ignore_on(self):
assert not hasattr(self, "_ignore_backup")
self._ignore_backup = self.config.check_ignore
@@ -194,6 +196,7 @@ class TcpMixin:
class AppMixin:
+
def test_app(self):
ret = self.app("/")
assert ret.status_code == 200
@@ -201,6 +204,7 @@ class AppMixin:
class TestHTTP(tservers.HTTPProxTest, CommonMixin, AppMixin):
+
def test_app_err(self):
p = self.pathoc()
ret = p.request("get:'http://errapp/'")
@@ -348,6 +352,7 @@ class TestHTTPSCertfile(tservers.HTTPProxTest, CommonMixin):
class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxTest):
+
"""
Test upstream server certificate verification with a trusted server cert.
"""
@@ -374,6 +379,7 @@ class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxTest):
class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxTest):
+
"""
Test upstream server certificate verification with an untrusted server cert.
"""
@@ -412,6 +418,7 @@ class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxTest):
class TestHTTPSNoCommonName(tservers.HTTPProxTest):
+
"""
Test what happens if we get a cert without common name back.
"""
@@ -432,6 +439,7 @@ class TestReverse(tservers.ReverseProxTest, CommonMixin, TcpMixin):
class TestSocks5(tservers.SocksModeTest):
+
def test_simple(self):
p = self.pathoc()
p.socks_connect(("localhost", self.server.port))
@@ -469,6 +477,7 @@ class TestSocks5(tservers.SocksModeTest):
class TestHttps2Http(tservers.ReverseProxTest):
+
@classmethod
def get_proxy_config(cls):
d = super(TestHttps2Http, cls).get_proxy_config()
@@ -526,6 +535,7 @@ class TestTransparentSSL(tservers.TransparentProxTest, CommonMixin, TcpMixin):
class TestProxy(tservers.HTTPProxTest):
+
def test_http(self):
f = self.pathod("304")
assert f.status_code == 304
@@ -562,7 +572,7 @@ class TestProxy(tservers.HTTPProxTest):
connection.close()
request, response = self.master.state.view[
- 0].request, self.master.state.view[0].response
+ 0].request, self.master.state.view[0].response
assert response.status_code == 304 # sanity test for our low level request
# timestamp_start might fire a bit late, so we play safe and only require 300ms.
assert 0.3 <= request.timestamp_end - request.timestamp_start
@@ -678,6 +688,7 @@ class TestRedirectRequest(tservers.HTTPProxTest):
class MasterStreamRequest(tservers.TestMaster):
+
"""
Enables the stream flag on the flow for all requests
"""
@@ -731,6 +742,7 @@ class TestStreamRequest(tservers.HTTPProxTest):
class MasterFakeResponse(tservers.TestMaster):
+
def handle_request(self, f):
resp = HTTPResponse.wrap(netlib.tutils.tresp())
f.reply(resp)
@@ -748,6 +760,7 @@ class TestServerConnect(tservers.HTTPProxTest):
masterclass = MasterFakeResponse
no_upstream_cert = True
ssl = True
+
def test_unnecessary_serverconnect(self):
"""A replayed/fake response with no_upstream_cert should not connect to an upstream server"""
assert self.pathod("200").status_code == 200
@@ -756,6 +769,7 @@ class TestServerConnect(tservers.HTTPProxTest):
class MasterKillRequest(tservers.TestMaster):
+
def handle_request(self, f):
f.reply(Kill)
@@ -771,6 +785,7 @@ class TestKillRequest(tservers.HTTPProxTest):
class MasterKillResponse(tservers.TestMaster):
+
def handle_response(self, f):
f.reply(Kill)
@@ -786,6 +801,7 @@ class TestKillResponse(tservers.HTTPProxTest):
class EResolver(tservers.TResolver):
+
def original_addr(self, sock):
raise RuntimeError("Could not resolve original destination.")
@@ -798,6 +814,7 @@ class TestTransparentResolveError(tservers.TransparentProxTest):
class MasterIncomplete(tservers.TestMaster):
+
def handle_request(self, f):
resp = HTTPResponse.wrap(netlib.tutils.tresp())
resp.content = CONTENT_MISSING
@@ -833,9 +850,9 @@ class TestUpstreamProxy(tservers.HTTPUpstreamProxTest, CommonMixin, AppMixin):
class TestUpstreamProxySSL(
- tservers.HTTPUpstreamProxTest,
- CommonMixin,
- TcpMixin):
+ tservers.HTTPUpstreamProxTest,
+ CommonMixin,
+ TcpMixin):
ssl = True
def _host_pattern_on(self, attr):
@@ -930,7 +947,7 @@ class TestProxyChainingSSLReconnect(tservers.HTTPUpstreamProxTest):
exclude=[
# fail first request
2, # allow second request
- ])
+ ])
kill_requests(self.chain[0].tmaster, "handle_request",
exclude=[
@@ -938,7 +955,7 @@ class TestProxyChainingSSLReconnect(tservers.HTTPUpstreamProxTest):
# fail first request
3, # reCONNECT
4, # request
- ])
+ ])
p = self.pathoc()
req = p.request("get:'/p/418:b\"content\"'")
@@ -954,7 +971,6 @@ class TestProxyChainingSSLReconnect(tservers.HTTPUpstreamProxTest):
# (doesn't store (repeated) CONNECTs from chain[0]
# as it is a regular proxy)
-
assert not self.chain[1].tmaster.state.flows[0].response # killed
assert self.chain[1].tmaster.state.flows[1].response
@@ -962,18 +978,18 @@ class TestProxyChainingSSLReconnect(tservers.HTTPUpstreamProxTest):
assert self.proxy.tmaster.state.flows[1].request.form_in == "relative"
assert self.chain[0].tmaster.state.flows[
- 0].request.form_in == "authority"
+ 0].request.form_in == "authority"
assert self.chain[0].tmaster.state.flows[
- 1].request.form_in == "relative"
+ 1].request.form_in == "relative"
assert self.chain[0].tmaster.state.flows[
- 2].request.form_in == "authority"
+ 2].request.form_in == "authority"
assert self.chain[0].tmaster.state.flows[
- 3].request.form_in == "relative"
+ 3].request.form_in == "relative"
assert self.chain[1].tmaster.state.flows[
- 0].request.form_in == "relative"
+ 0].request.form_in == "relative"
assert self.chain[1].tmaster.state.flows[
- 1].request.form_in == "relative"
+ 1].request.form_in == "relative"
req = p.request("get:'/p/418:b\"content2\"'")
diff --git a/test/tools/benchtool.py b/test/tools/benchtool.py
index ae4636a7..a1d80697 100644
--- a/test/tools/benchtool.py
+++ b/test/tools/benchtool.py
@@ -15,6 +15,7 @@ import click
class ApacheBenchThread(Thread):
+
def __init__(self, concurrency):
self.concurrency = concurrency
super(ApacheBenchThread, self).__init__()
diff --git a/test/tools/inspect_dumpfile.py b/test/tools/inspect_dumpfile.py
index 8ba42c2a..d15e9e8a 100644
--- a/test/tools/inspect_dumpfile.py
+++ b/test/tools/inspect_dumpfile.py
@@ -15,6 +15,7 @@ def read_tnetstring(input):
input.seek(-1, 1)
return tnetstring.load(input)
+
@click.command()
@click.argument("input", type=click.File('rb'))
def inspect(input):
diff --git a/test/tools/memoryleak.py b/test/tools/memoryleak.py
index 47cfff38..259309a6 100644
--- a/test/tools/memoryleak.py
+++ b/test/tools/memoryleak.py
@@ -18,7 +18,7 @@ def str_fun(obj):
return "(-locals-)"
if "self" in obj and isinstance(obj["self"], refbrowser.InteractiveBrowser):
return "(-browser-)"
- return str(id(obj)) + ": " + str(obj)[:100].replace("\r\n","\\r\\n").replace("\n","\\n")
+ return str(id(obj)) + ": " + str(obj)[:100].replace("\r\n", "\\r\\n").replace("\n", "\\n")
def request(ctx, flow):
@@ -35,4 +35,4 @@ def request(ctx, flow):
ib = refbrowser.InteractiveBrowser(ssl, 2, str_fun, repeat=False)
del ssl # do this to unpollute view
ib.main(True)
- # print("\r\n".join(str(x)[:100] for x in gc.get_referrers(ssl))) \ No newline at end of file
+ # print("\r\n".join(str(x)[:100] for x in gc.get_referrers(ssl)))
diff --git a/test/tools/passive_close.py b/test/tools/passive_close.py
index 87d8846c..5b1bd451 100644
--- a/test/tools/passive_close.py
+++ b/test/tools/passive_close.py
@@ -3,6 +3,7 @@ from time import sleep
class service(SocketServer.BaseRequestHandler):
+
def handle(self):
data = 'dummy'
print "Client connected with ", self.client_address
diff --git a/test/tservers.py b/test/tservers.py
index c5b23854..dbc9f7d0 100644
--- a/test/tservers.py
+++ b/test/tservers.py
@@ -29,6 +29,7 @@ def errapp(environ, start_response):
class TestMaster(flow.FlowMaster):
+
def __init__(self, config):
config.port = 0
s = ProxyServer(config)
@@ -55,6 +56,7 @@ class TestMaster(flow.FlowMaster):
class ProxyThread(threading.Thread):
+
def __init__(self, tmaster):
threading.Thread.__init__(self)
self.tmaster = tmaster
@@ -131,6 +133,7 @@ class ProxTestBase(object):
class HTTPProxTest(ProxTestBase):
+
def pathoc_raw(self):
return libpathod.pathoc.Pathoc(("127.0.0.1", self.proxy.port), fp=None)
@@ -172,12 +175,14 @@ class HTTPProxTest(ProxTestBase):
class TResolver:
+
def __init__(self, port):
self.port = port
def original_addr(self, sock):
return ("127.0.0.1", self.port)
+
class TransparentProxTest(ProxTestBase):
ssl = None
resolver = TResolver
@@ -263,6 +268,7 @@ class ReverseProxTest(ProxTestBase):
class SocksModeTest(HTTPProxTest):
+
@classmethod
def get_proxy_config(cls):
d = ProxTestBase.get_proxy_config()
@@ -271,6 +277,7 @@ class SocksModeTest(HTTPProxTest):
class ChainProxTest(ProxTestBase):
+
"""
Chain three instances of mitmproxy in a row to test upstream mode.
Proxy order is cls.proxy -> cls.chain[0] -> cls.chain[1]
diff --git a/test/tutils.py b/test/tutils.py
index 8f92b596..5bd91307 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -121,6 +121,7 @@ def tmpdir(*args, **kwargs):
class MockParser(argparse.ArgumentParser):
+
"""
argparse.ArgumentParser sys.exits() by default.
Make it more testable by throwing an exception instead.