diff options
author | Aldo Cortesi <aldo@corte.si> | 2018-05-08 11:23:52 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2018-05-08 14:26:41 +1200 |
commit | af1a4ffdcd4c98afefd4228bbc2bc276cfd8436f (patch) | |
tree | dacb5e2dae27aabb550b93b181cac0197072707e /test | |
parent | 717fbaa99076545d11f554187759005dce1aa67b (diff) | |
download | mitmproxy-af1a4ffdcd4c98afefd4228bbc2bc276cfd8436f.tar.gz mitmproxy-af1a4ffdcd4c98afefd4228bbc2bc276cfd8436f.tar.bz2 mitmproxy-af1a4ffdcd4c98afefd4228bbc2bc276cfd8436f.zip |
Ditch the addon stdout wrapper
This results in a 30% improvement in our core request throughput.
Fixes #3102
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_script.py | 11 | ||||
-rw-r--r-- | test/mitmproxy/data/addonscripts/print.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_addonmanager.py | 7 |
3 files changed, 0 insertions, 20 deletions
diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index 62762809..573b36e7 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -60,17 +60,6 @@ def test_load_fullname(tdata): assert not hasattr(ns2, "addons") -@pytest.mark.asyncio -async def test_script_print_stdout(tdata): - with taddons.context() as tctx: - with addonmanager.safecall(): - ns = script.load_script( - tdata.path("mitmproxy/data/addonscripts/print.py") - ) - ns.load(addonmanager.Loader(tctx.master)) - assert await tctx.master.await_log("stdoutprint") - - class TestScript: def test_notfound(self): with taddons.context(): diff --git a/test/mitmproxy/data/addonscripts/print.py b/test/mitmproxy/data/addonscripts/print.py deleted file mode 100644 index 93b65a64..00000000 --- a/test/mitmproxy/data/addonscripts/print.py +++ /dev/null @@ -1,2 +0,0 @@ -def load(l): - print("stdoutprint") diff --git a/test/mitmproxy/test_addonmanager.py b/test/mitmproxy/test_addonmanager.py index a1f0a943..660db549 100644 --- a/test/mitmproxy/test_addonmanager.py +++ b/test/mitmproxy/test_addonmanager.py @@ -196,10 +196,3 @@ class D: def log(self, x): self.w = x - - -def test_streamlog(): - dummy = D() - s = addonmanager.StreamLog(dummy.log) - s.write("foo") - assert dummy.w == "foo" |