From: Can Sarıgöl Date: Thu, 15 Aug 2019 02:45:28 +0000 (+0300) Subject: Fail unit tests without 100% coverage (#206) X-Git-Tag: 0.7.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9536b76f5c8e4de6f748258dec9873177caf4b46;p=thirdparty%2Fhttpx.git Fail unit tests without 100% coverage (#206) --- diff --git a/setup.cfg b/setup.cfg index 3077d460..feb7f5a7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,4 +16,4 @@ line_length = 88 multi_line_output = 3 [tool:pytest] -addopts = --cov=httpx --cov=tests --cov-report=term-missing +addopts = --cov=httpx --cov=tests --cov-report=term-missing --cov-fail-under=100 diff --git a/tests/test_utils.py b/tests/test_utils.py index a6085fc7..6cb4537e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -50,6 +50,12 @@ def test_bad_get_netrc_login(): os.environ["NETRC"] = "wrongpath" assert get_netrc_login("url") is None + from httpx import utils + + utils.NETRC_STATIC_FILES = () + os.environ["NETRC"] = "" + assert utils.get_netrc_login("url") is None + def test_get_netrc_login(): os.environ["NETRC"] = "tests/.netrc"