diff --git a/test/helper_tools/ab.exe b/test/helper_tools/ab.exe deleted file mode 100644 index d68ed0f31..000000000 Binary files a/test/helper_tools/ab.exe and /dev/null differ diff --git a/test/individual_coverage.py b/test/individual_coverage.py index 35bcd27f5..c975b4c81 100644 --- a/test/individual_coverage.py +++ b/test/individual_coverage.py @@ -26,20 +26,20 @@ def run_tests(src, test, fail): if e == 0: if fail: - print("SUCCESS but should have FAILED:", src, "Please remove this file from setup.cfg tool:individual_coverage/exclude.") + print("UNEXPECTED SUCCESS:", src, "Please remove this file from setup.cfg tool:individual_coverage/exclude.") e = 42 else: - print("SUCCESS:", src) + print("SUCCESS: ", src) else: if fail: - print("Ignoring fail:", src) + print("IGNORING FAIL: ", src) e = 0 else: cov = [l for l in stdout.getvalue().split("\n") if (src in l) or ("was never imported" in l)] if len(cov) == 1: - print("FAIL:", cov[0]) + print("FAIL: ", cov[0]) else: - print("FAIL:", src, test, stdout.getvalue(), stdout.getvalue()) + print("FAIL: ", src, test, stdout.getvalue(), stdout.getvalue()) print(stderr.getvalue()) print(stdout.getvalue()) diff --git a/test/mitmproxy/addons/onboardingapp/__init__.py b/test/mitmproxy/addons/onboardingapp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/test/mitmproxy/addons/test_defaults.py b/test/mitmproxy/addons/test_defaults.py deleted file mode 100644 index e20466f1c..000000000 --- a/test/mitmproxy/addons/test_defaults.py +++ /dev/null @@ -1,5 +0,0 @@ -from mitmproxy import addons - - -def test_defaults(): - assert addons.default_addons() diff --git a/test/mitmproxy/net/test_imports.py b/test/mitmproxy/net/test_imports.py deleted file mode 100644 index b88ef26d0..000000000 --- a/test/mitmproxy/net/test_imports.py +++ /dev/null @@ -1 +0,0 @@ -# These are actually tests! diff --git a/test/mitmproxy/platform/__init__.py b/test/mitmproxy/platform/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/test/mitmproxy/proxy/protocol/test_http2.py b/test/mitmproxy/proxy/protocol/test_http2.py index 23027c242..b07257b3b 100644 --- a/test/mitmproxy/proxy/protocol/test_http2.py +++ b/test/mitmproxy/proxy/protocol/test_http2.py @@ -11,7 +11,7 @@ from mitmproxy import options from mitmproxy.proxy.config import ProxyConfig import mitmproxy.net -from ....mitmproxy.net import tservers as net_tservers +from ...net import tservers as net_tservers from mitmproxy import exceptions from mitmproxy.net.http import http1, http2 diff --git a/test/mitmproxy/proxy/protocol/test_websocket.py b/test/mitmproxy/proxy/protocol/test_websocket.py index 486e9d64c..8dfc4f2b5 100644 --- a/test/mitmproxy/proxy/protocol/test_websocket.py +++ b/test/mitmproxy/proxy/protocol/test_websocket.py @@ -11,7 +11,7 @@ from mitmproxy.proxy.config import ProxyConfig from mitmproxy.net import tcp from mitmproxy.net import http -from ....mitmproxy.net import tservers as net_tservers +from ...net import tservers as net_tservers from ... import tservers from mitmproxy.net import websockets diff --git a/test/mitmproxy/test_addonmanager.py b/test/mitmproxy/test_addonmanager.py index 5bb88eb6f..e556bf7d2 100644 --- a/test/mitmproxy/test_addonmanager.py +++ b/test/mitmproxy/test_addonmanager.py @@ -1,5 +1,6 @@ import pytest +from mitmproxy import addons from mitmproxy import addonmanager from mitmproxy import exceptions from mitmproxy import options @@ -76,6 +77,10 @@ def test_lifecycle(): a.configure_all(o, o.keys()) +def test_defaults(): + assert addons.default_addons() + + def test_simple(): o = options.Options() m = master.Master(o, proxy.DummyServer(o)) diff --git a/test/mitmproxy/test_proxy.py b/test/mitmproxy/test_proxy.py index 7a49c5304..e1d0da006 100644 --- a/test/mitmproxy/test_proxy.py +++ b/test/mitmproxy/test_proxy.py @@ -3,7 +3,6 @@ from unittest import mock from OpenSSL import SSL import pytest - from mitmproxy.tools import cmdline from mitmproxy.tools import main from mitmproxy import options diff --git a/test/mitmproxy/tools/console/test_pathedit.py b/test/mitmproxy/tools/console/test_pathedit.py index bd064e5fa..b9f51f5aa 100644 --- a/test/mitmproxy/tools/console/test_pathedit.py +++ b/test/mitmproxy/tools/console/test_pathedit.py @@ -1,10 +1,10 @@ import os from os.path import normpath +from unittest import mock + from mitmproxy.tools.console import pathedit from mitmproxy.test import tutils -from unittest.mock import patch - class TestPathCompleter: @@ -56,8 +56,8 @@ class TestPathEdit: pe = pathedit.PathEdit("", "") - with patch('urwid.widget.Edit.get_edit_text') as get_text, \ - patch('urwid.widget.Edit.set_edit_text') as set_text: + with mock.patch('urwid.widget.Edit.get_edit_text') as get_text, \ + mock.patch('urwid.widget.Edit.set_edit_text') as set_text: cd = os.path.normpath(tutils.test_data.path("mitmproxy/completion")) get_text.return_value = os.path.join(cd, "a")