From 15270dfaf0a139581807d1f2cd3171291d63d359 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 30 Jul 2020 09:07:35 +0200 Subject: [PATCH 1/2] don't count overage for AssertionErrors A common pattern in sans-io is to essentially match on all variants of an enum, and then have a `else: raise AssertionError` in the end. This increases robustness as we spot incomplete coverage instead of silently passing. However, it makes no sense to explicitly test these asserts. --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a800ae1f9..c9c19704f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,8 @@ omit = *contrib*, *tnetstring*, *platform*, *main.py show_missing = True exclude_lines = pragma: no cover - raise NotImplementedError() + raise NotImplementedError + raise AssertionError if typing.TYPE_CHECKING: if TYPE_CHECKING: @overload From ab1e607c70d6576efccd06eb4c17074da827cbf2 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 30 Jul 2020 09:23:41 +0200 Subject: [PATCH 2/2] increase pytest verbosity to catch flaky test --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9fba58756..8112fdd95 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = setenv = HOME = {envtmpdir} commands = mitmdump --version - pytest --timeout 60 --cov-report xml \ + pytest --timeout 60 -v --cov-report xml \ --cov=mitmproxy --cov=pathod --cov=release \ --full-cov=mitmproxy/ --full-cov=pathod/ \ {posargs}