aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-x[-rw-r--r--]test/filename_matching.py2
-rwxr-xr-x[-rw-r--r--]test/individual_coverage.py2
-rw-r--r--test/mitmproxy/utils/test_typecheck.py19
3 files changed, 4 insertions, 19 deletions
diff --git a/test/filename_matching.py b/test/filename_matching.py
index e74848d4..5f49725e 100644..100755
--- a/test/filename_matching.py
+++ b/test/filename_matching.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
import os
import re
import glob
diff --git a/test/individual_coverage.py b/test/individual_coverage.py
index c975b4c8..097b290f 100644..100755
--- a/test/individual_coverage.py
+++ b/test/individual_coverage.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
import io
import contextlib
import os
diff --git a/test/mitmproxy/utils/test_typecheck.py b/test/mitmproxy/utils/test_typecheck.py
index 9cb4334e..85713e14 100644
--- a/test/mitmproxy/utils/test_typecheck.py
+++ b/test/mitmproxy/utils/test_typecheck.py
@@ -1,6 +1,5 @@
import io
import typing
-from unittest import mock
import pytest
from mitmproxy.utils import typecheck
@@ -32,12 +31,6 @@ def test_check_union():
with pytest.raises(TypeError):
typecheck.check_option_type("foo", [], typing.Union[int, str])
- # Python 3.5 only defines __union_params__
- m = mock.Mock()
- m.__str__ = lambda self: "typing.Union"
- m.__union_params__ = (int,)
- typecheck.check_option_type("foo", 42, m)
-
def test_check_tuple():
typecheck.check_option_type("foo", (42, "42"), typing.Tuple[int, str])
@@ -50,12 +43,6 @@ def test_check_tuple():
with pytest.raises(TypeError):
typecheck.check_option_type("foo", ("42", 42), typing.Tuple[int, str])
- # Python 3.5 only defines __tuple_params__
- m = mock.Mock()
- m.__str__ = lambda self: "typing.Tuple"
- m.__tuple_params__ = (int, str)
- typecheck.check_option_type("foo", (42, "42"), m)
-
def test_check_sequence():
typecheck.check_option_type("foo", [10], typing.Sequence[int])
@@ -68,12 +55,6 @@ def test_check_sequence():
with pytest.raises(TypeError):
typecheck.check_option_type("foo", "foo", typing.Sequence[str])
- # Python 3.5 only defines __parameters__
- m = mock.Mock()
- m.__str__ = lambda self: "typing.Sequence"
- m.__parameters__ = (int,)
- typecheck.check_option_type("foo", [10], m)
-
def test_check_io():
typecheck.check_option_type("foo", io.StringIO(), typing.IO[str])