Skip to content

Commit 07e51e7

Browse files
committed
Capture stdout by capfd
1 parent b64d1f7 commit 07e51e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/functional/test_proxy.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ def on_access_log(self, context: Dict[str, Any]) -> None:
2222

2323

2424
@pytest.mark.network
25-
def test_proxy_overrides_env(script: PipTestEnvironment) -> None:
25+
def test_proxy_overrides_env(
26+
script: PipTestEnvironment, capfd: pytest.CaptureFixture[str]
27+
) -> None:
2628
with proxy.Proxy(
2729
port=8899,
2830
num_acceptors=1,
@@ -40,7 +42,8 @@ def test_proxy_overrides_env(script: PipTestEnvironment) -> None:
4042
"INITools==0.1",
4143
)
4244
result.did_create(Path("scratch") / "pip_downloads" / "INITools-0.1.tar.gz")
43-
assert "CONNECT" not in result.stdout
45+
out, _ = capfd.readouterr()
46+
assert "CONNECT" not in out
4447

4548

4649
def test_proxy_does_not_override_netrc(

0 commit comments

Comments
 (0)