MCPcopy
hub / github.com/tox-dev/tox / test_exec_always_no_capture

Function test_exec_always_no_capture

tests/session/cmd/test_exec_.py:48–68  ·  view source on GitHub ↗

Verify tox exec always runs with no_capture enabled for interactive mode.

(tox_project: ToxProjectCreator)

Source from the content-addressed store, hash-verified

46
47
48def test_exec_always_no_capture(tox_project: ToxProjectCreator) -> None:
49 """Verify tox exec always runs with no_capture enabled for interactive mode."""
50 ini = "[testenv]\npackage=skip"
51 project = tox_project({"tox.ini": ini})
52
53 captured_options: list[MagicMock] = []
54
55 def capture_options(request): # noqa: ANN001, ANN202
56 captured_options.append(request)
57 return 0
58
59 execute_calls = project.patch_execute(capture_options)
60 result = project.run("e", "-e", "py", "--", "python", "--version")
61 result.assert_success()
62
63 assert execute_calls.call_count > 0
64 for call in execute_calls.call_args_list:
65 _, kwargs = call
66 env_instance = kwargs.get("self")
67 if env_instance and hasattr(env_instance, "options"):
68 assert env_instance.options.no_capture is True
69
70
71def test_exec_passes_stdin_through(tox_project: ToxProjectCreator, monkeypatch: pytest.MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 4

patch_executeMethod · 0.80
getMethod · 0.80
runMethod · 0.45
assert_successMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…