File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-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,15 @@ 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+ # Simulate sys.stdout.isatty() + sys.stderr.isatty()
45+ monkeypatch .setattr (sys .stdout , "isatty" , lambda : True )
46+ monkeypatch .setattr (sys .stderr , "isatty" , lambda : True )
47+
4048 script_file = FIXTURE_PATH / "script_complete.sh"
4149
4250 run_before_script (script_file )
You can’t perform that action at this time.
0 commit comments