]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Cleanup unneccessary test case (#3375)
authorTom Christie <tom@tomchristie.com>
Mon, 28 Oct 2024 17:38:33 +0000 (17:38 +0000)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2024 17:38:33 +0000 (17:38 +0000)
tests/client/test_auth.py

index b3aeaf4e4b4f24ec8b5ec84932f4654481ac9794..7638b8bd68d4e505dc378185c23265361fcbf92b 100644 (file)
@@ -270,29 +270,6 @@ def test_netrc_auth_credentials_do_not_exist() -> None:
     assert response.json() == {"auth": None}
 
 
-@pytest.mark.skipif(
-    sys.version_info < (3, 11),
-    reason="netrc files without a password are invalid with Python < 3.11",
-)
-def test_netrc_auth_nopassword() -> None:  # pragma: no cover
-    """
-    Python has different netrc parsing behaviours with different versions.
-    For Python 3.11+ a netrc file with no password is valid. In this case
-    we want to check that we allow the netrc auth, and simply don't provide
-    any credentials in the request.
-    """
-    netrc_file = str(FIXTURES_DIR / ".netrc-nopassword")
-    url = "http://example.org"
-    app = App()
-    auth = httpx.NetRCAuth(netrc_file)
-
-    with httpx.Client(transport=httpx.MockTransport(app), auth=auth) as client:
-        response = client.get(url)
-
-    assert response.status_code == 200
-    assert response.json() == {"auth": None}
-
-
 @pytest.mark.skipif(
     sys.version_info >= (3, 11),
     reason="netrc files without a password are valid from Python >= 3.11",