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 2
2
3
3
from __future__ import annotations
4
4
5
+ import sys
5
6
import typing as t
6
7
7
8
import pytest
@@ -35,8 +36,15 @@ def test_run_before_script_raise_BeforeLoadScriptError_if_retcode() -> None:
35
36
run_before_script (script_file )
36
37
37
38
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 :
39
43
"""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
+
40
48
script_file = FIXTURE_PATH / "script_complete.sh"
41
49
42
50
run_before_script (script_file )
You can’t perform that action at this time.
0 commit comments