diff --git a/mitmproxy/utils/typecheck.py b/mitmproxy/utils/typecheck.py index 49ce3b90f..6279cfaeb 100644 --- a/mitmproxy/utils/typecheck.py +++ b/mitmproxy/utils/typecheck.py @@ -3,7 +3,7 @@ from collections import abc try: from types import UnionType -except ImportError: +except ImportError: # pragma: no cover UnionType = object() # type: ignore Type = typing.Union[ diff --git a/setup.cfg b/setup.cfg index 660b9a264..bfa7e08e8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,6 +25,7 @@ exclude_lines = if typing.TYPE_CHECKING: if TYPE_CHECKING: @overload + @abstractmethod [mypy] ignore_missing_imports = True diff --git a/test/individual_coverage.py b/test/individual_coverage.py index 7c989c385..e3c5ef534 100755 --- a/test/individual_coverage.py +++ b/test/individual_coverage.py @@ -87,6 +87,8 @@ def main(): src_files = [ f for f in src_files if not any(os.path.normpath(p) in f for p in excluded) ] + if len(sys.argv) > 1: + src_files = [f for f in src_files if sys.argv[1] in str(f)] ps = [] for src in sorted(src_files): diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py index be0a10022..8f8b7b0e4 100644 --- a/test/mitmproxy/addons/test_view.py +++ b/test/mitmproxy/addons/test_view.py @@ -329,6 +329,12 @@ def test_movement(): v.focus_prev() assert v.focus.index == 0 + v.clear() + v.focus_next() + assert v.focus.index is None + v.focus_prev() + assert v.focus.index is None + def test_duplicate(): v = view.View() diff --git a/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html b/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html index 0eb600048..015043fea 100644 --- a/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html +++ b/test/mitmproxy/contentviews/test_xml_html_data/test-formatted.html @@ -40,5 +40,6 @@
esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+