aboutsummaryrefslogtreecommitdiffstats
path: root/test/tutils.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-05-30 12:03:13 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-05-30 12:03:13 +1200
commit4ed5043c67848bf717e48bc509d959422c8faeb6 (patch)
tree92abe731c72d34bf6b43cbe1ecb46939953a6860 /test/tutils.py
parent904760c6c2927caf49b7cbe4027dd1c8dd8e9fdb (diff)
downloadmitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.tar.gz
mitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.tar.bz2
mitmproxy-4ed5043c67848bf717e48bc509d959422c8faeb6.zip
Add coding style check, reformat.
Diffstat (limited to 'test/tutils.py')
-rw-r--r--test/tutils.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/tutils.py b/test/tutils.py
index 07252b53..933c7f59 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -30,7 +30,7 @@ class DaemonTests(object):
],
ssl = klass.ssl,
ssloptions = so,
- sizelimit = 1*1024*1024,
+ sizelimit = 1 * 1024 * 1024,
noweb = klass.noweb,
noapi = klass.noapi,
nohang = klass.nohang,
@@ -53,7 +53,7 @@ class DaemonTests(object):
def getpath(self, path, params=None):
scheme = "https" if self.ssl else "http"
return requests.get(
- "%s://localhost:%s/%s"%(
+ "%s://localhost:%s/%s" % (
scheme,
self.d.port,
path
@@ -115,14 +115,14 @@ def raises(exc, obj, *args, **kwargs):
:kwargs Arguments to be passed to the callable.
"""
try:
- apply(obj, args, kwargs)
- except (Exception, SystemExit), v:
+ obj(*args, **kwargs)
+ except (Exception, SystemExit) as v:
if isinstance(exc, basestring):
if exc.lower() in str(v).lower():
return
else:
raise AssertionError(
- "Expected %s, but caught %s"%(
+ "Expected %s, but caught %s" % (
repr(str(exc)), v
)
)
@@ -131,7 +131,7 @@ def raises(exc, obj, *args, **kwargs):
return
else:
raise AssertionError(
- "Expected %s, but caught %s %s"%(
+ "Expected %s, but caught %s %s" % (
exc.__name__, v.__class__.__name__, str(v)
)
)