From 403e63d6f27d397be0b72c7def7e2541523bff78 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 5 Dec 2018 09:05:32 +0100 Subject: [PATCH] Configure coverage.py for "if MYPY:" --- .coveragerc | 1 + qutebrowser/api/config.py | 2 +- qutebrowser/config/config.py | 2 +- qutebrowser/config/configcommands.py | 2 +- qutebrowser/config/configfiles.py | 2 +- qutebrowser/config/configutils.py | 2 +- qutebrowser/misc/objects.py | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.coveragerc b/.coveragerc index 9ba8e8a5e..69b126e12 100644 --- a/.coveragerc +++ b/.coveragerc @@ -14,6 +14,7 @@ exclude_lines = raise NotImplementedError raise utils\.Unreachable if __name__ == ["']__main__["']: + if MYPY: [xml] output=coverage.xml diff --git a/qutebrowser/api/config.py b/qutebrowser/api/config.py index d45703242..6558cf42a 100644 --- a/qutebrowser/api/config.py +++ b/qutebrowser/api/config.py @@ -22,7 +22,7 @@ import typing MYPY = False -if MYPY: # pragma: no cover +if MYPY: # pylint: disable=unused-import,useless-suppression from qutebrowser.config import config diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 44bf3ca77..80826beeb 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -33,7 +33,7 @@ from qutebrowser.misc import objects from qutebrowser.keyinput import keyutils MYPY = False -if MYPY: # pragma: no cover +if MYPY: # pylint: disable=unused-import,useless-suppression from typing import Tuple, MutableMapping from qutebrowser.config import configcache, configfiles diff --git a/qutebrowser/config/configcommands.py b/qutebrowser/config/configcommands.py index 0ee77fcc9..5d5b2db7e 100644 --- a/qutebrowser/config/configcommands.py +++ b/qutebrowser/config/configcommands.py @@ -33,7 +33,7 @@ from qutebrowser.misc import editor from qutebrowser.keyinput import keyutils MYPY = False -if MYPY: # pragma: no cover +if MYPY: # pylint: disable=unused-import,useless-suppression from qutebrowser.config.config import Config, KeyConfig diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index d11c0d976..54ca91488 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -38,7 +38,7 @@ from qutebrowser.keyinput import keyutils from qutebrowser.utils import standarddir, utils, qtutils, log, urlmatch MYPY = False -if MYPY: # pragma: no cover +if MYPY: # pylint: disable=unused-import, useless-suppression from qutebrowser.misc import savemanager diff --git a/qutebrowser/config/configutils.py b/qutebrowser/config/configutils.py index 9d4dc94ef..efdc5611e 100644 --- a/qutebrowser/config/configutils.py +++ b/qutebrowser/config/configutils.py @@ -30,7 +30,7 @@ from qutebrowser.utils import utils, urlmatch from qutebrowser.config import configexc MYPY = False -if MYPY: # pragma: no cover +if MYPY: # pylint: disable=unused-import,useless-suppression from qutebrowser.config import configdata diff --git a/qutebrowser/misc/objects.py b/qutebrowser/misc/objects.py index ccb5d09b3..0bb26954c 100644 --- a/qutebrowser/misc/objects.py +++ b/qutebrowser/misc/objects.py @@ -25,7 +25,7 @@ import typing MYPY = False -if MYPY: # pragma: no cover +if MYPY: # pylint: disable=unused-import,useless-suppression from qutebrowser.utils import usertypes from qutebrowser.commands import command