diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-06-08 15:23:56 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-06-08 15:23:56 +1200 |
commit | 317db546667592c5ebbd2249b775ff32f16a5b13 (patch) | |
tree | 35ad1e53ea47baa8d82895a391473fd064ff5434 /test/tutils.py | |
parent | af22814bc34ab9521def8d190e555364b93dc8be (diff) | |
download | mitmproxy-317db546667592c5ebbd2249b775ff32f16a5b13.tar.gz mitmproxy-317db546667592c5ebbd2249b775ff32f16a5b13.tar.bz2 mitmproxy-317db546667592c5ebbd2249b775ff32f16a5b13.zip |
Revamp timeout handling and test logging
Diffstat (limited to 'test/tutils.py')
-rw-r--r-- | test/tutils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/tutils.py b/test/tutils.py index 1e33dfe7..5988e846 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -75,13 +75,17 @@ class DaemonTests(object): ssl=None, ws_read_limit=None ): + """ + Returns a (messages, text log) tuple. + """ if ssl is None: ssl = self.ssl + logfp = cStringIO.StringIO() c = pathoc.Pathoc( ("localhost", self.d.port), ssl=ssl, ws_read_limit=ws_read_limit, - fp = None + fp = logfp ) c.connect(connect_to) if timeout: @@ -93,7 +97,7 @@ class DaemonTests(object): ret.append(resp) for frm in c.wait(): ret.append(frm) - return ret + return ret, logfp.getvalue() @contextmanager def tmpdir(*args, **kwargs): |