]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Fail unit tests without 100% coverage (#206)
authorCan Sarıgöl <cansarigol@derinbilgi.com.tr>
Thu, 15 Aug 2019 02:45:28 +0000 (05:45 +0300)
committerSeth Michael Larson <sethmichaellarson@gmail.com>
Thu, 15 Aug 2019 02:45:28 +0000 (21:45 -0500)
setup.cfg
tests/test_utils.py

index 3077d4606194fc2f1f684286c74ac9eeaf54c566..feb7f5a7ead7a911cabd6212a60045f304886d21 100644 (file)
--- 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
index a6085fc7cd483b3f26e9068a4cf9ac93828ff0c1..6cb4537e3178dcd83356fbc413e3dfe861c92e66 100644 (file)
@@ -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"