Skip to content

Commit 9536b76

Browse files
Can Sarıgölsethmlarson
authored andcommitted
Fail unit tests without 100% coverage (#206)
1 parent 45177d2 commit 9536b76

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ line_length = 88
1616
multi_line_output = 3
1717

1818
[tool:pytest]
19-
addopts = --cov=httpx --cov=tests --cov-report=term-missing
19+
addopts = --cov=httpx --cov=tests --cov-report=term-missing --cov-fail-under=100

tests/test_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ def test_bad_get_netrc_login():
5050
os.environ["NETRC"] = "wrongpath"
5151
assert get_netrc_login("url") is None
5252

53+
from httpx import utils
54+
55+
utils.NETRC_STATIC_FILES = ()
56+
os.environ["NETRC"] = ""
57+
assert utils.get_netrc_login("url") is None
58+
5359

5460
def test_get_netrc_login():
5561
os.environ["NETRC"] = "tests/.netrc"

0 commit comments

Comments
 (0)