diff options
author | Aldo Cortesi <aldo@corte.si> | 2018-04-07 11:46:34 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2018-04-23 10:28:18 +1200 |
commit | 44016a0de519469792769f7b78c37e7de9bfde24 (patch) | |
tree | bd077442d797487df8aff9d7c0d3f6b76633b337 /mitmproxy/test | |
parent | f6b606b3643d0f447dac9830d25ac1853f8610fe (diff) | |
download | mitmproxy-44016a0de519469792769f7b78c37e7de9bfde24.tar.gz mitmproxy-44016a0de519469792769f7b78c37e7de9bfde24.tar.bz2 mitmproxy-44016a0de519469792769f7b78c37e7de9bfde24.zip |
asyncio: shift script reloading out of the tick event
The tick event is a nasty compromise, left over from when we didn't have an
event loop. This is the first patch in a series that explores moving our
built-in addons to managing coroutines on the eventloop directly for periodic
tasks.
Diffstat (limited to 'mitmproxy/test')
-rw-r--r-- | mitmproxy/test/taddons.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/mitmproxy/test/taddons.py b/mitmproxy/test/taddons.py index 73e57456..e0e4fef9 100644 --- a/mitmproxy/test/taddons.py +++ b/mitmproxy/test/taddons.py @@ -123,11 +123,7 @@ class context: """ Loads a script from path, and returns the enclosed addon. """ - sc = script.Script(path) - loader = addonmanager.Loader(self.master) - self.master.addons.invoke_addon(sc, "load", loader) - self.configure(sc) - self.master.addons.invoke_addon(sc, "tick") + sc = script.Script(path, False) return sc.addons[0] if sc.addons else None def invoke(self, addon, event, *args, **kwargs): |