Capture stdout by capfd

This commit is contained in:
q0w 2022-10-07 21:40:49 +03:00
parent b64d1f7980
commit 07e51e7e3c
1 changed files with 5 additions and 2 deletions

View File

@ -22,7 +22,9 @@ class AccessLogPlugin(HttpProxyBasePlugin):
@pytest.mark.network
def test_proxy_overrides_env(script: PipTestEnvironment) -> None:
def test_proxy_overrides_env(
script: PipTestEnvironment, capfd: pytest.CaptureFixture[str]
) -> None:
with proxy.Proxy(
port=8899,
num_acceptors=1,
@ -40,7 +42,8 @@ def test_proxy_overrides_env(script: PipTestEnvironment) -> None:
"INITools==0.1",
)
result.did_create(Path("scratch") / "pip_downloads" / "INITools-0.1.tar.gz")
assert "CONNECT" not in result.stdout
out, _ = capfd.readouterr()
assert "CONNECT" not in out
def test_proxy_does_not_override_netrc(