Verify tox exec always runs with no_capture enabled for interactive mode.
(tox_project: ToxProjectCreator)
| 46 | |
| 47 | |
| 48 | def 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 | |
| 71 | def test_exec_passes_stdin_through(tox_project: ToxProjectCreator, monkeypatch: pytest.MonkeyPatch) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…