File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5+ import sys
56import typing as t
67
78import pytest
@@ -35,8 +36,18 @@ def test_run_before_script_raise_BeforeLoadScriptError_if_retcode() -> None:
3536 run_before_script (script_file )
3637
3738
38- def test_return_stdout_if_ok (capsys : pytest .CaptureFixture [str ]) -> None :
39+ def test_return_stdout_if_ok (
40+ capsys : pytest .CaptureFixture [str ],
41+ monkeypatch : pytest .MonkeyPatch ,
42+ ) -> None :
3943 """run_before_script() returns stdout if script succeeds."""
44+
45+ def mock_isatty () -> bool :
46+ return True # or False for non-TTY tests
47+
48+ monkeypatch .setattr (sys .stdout , "isatty" , mock_isatty )
49+ monkeypatch .setattr (sys .stderr , "isatty" , mock_isatty )
50+
4051 script_file = FIXTURE_PATH / "script_complete.sh"
4152
4253 run_before_script (script_file )
You can’t perform that action at this time.
0 commit comments