aboutsummaryrefslogtreecommitdiffstats
path: root/test/helper_tools/typehints_for_options.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/helper_tools/typehints_for_options.py')
-rw-r--r--test/helper_tools/typehints_for_options.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/test/helper_tools/typehints_for_options.py b/test/helper_tools/typehints_for_options.py
deleted file mode 100644
index 06e958f9..00000000
--- a/test/helper_tools/typehints_for_options.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import typing
-from unittest import mock
-
-from mitmproxy import proxy, options
-from mitmproxy.tools import dump, console, web
-
-
-def print_typehints(opts):
- for name, option in sorted(opts.items()):
- print(
- # For Python 3.6, we can just use "{}: {}".
- "{}: {} = None".format(
- name,
- {
- int: "int",
- str: "str",
- bool: "bool",
- typing.Optional[str]: "Optional[str]",
- typing.Sequence[str]: "Sequence[str]"
- }[option.typespec]
- )
- )
-
-
-if __name__ == "__main__":
- opts = options.Options()
- server = proxy.server.DummyServer(None)
-
- # initialize with all three tools here to capture tool-specific options defined in addons.
- dump.DumpMaster(opts, server)
- with mock.patch("sys.stdout.isatty", lambda: True):
- console.master.ConsoleMaster(opts, server)
- web.master.WebMaster(opts, server)
- print_typehints(opts)