Skip to content

Commit e16a59c

Browse files
committed
Try to fix one failing test on Windows
1 parent c0a283e commit e16a59c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_cmd2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,9 +1919,10 @@ def test_read_input_rawinput_true(capsys, monkeypatch) -> None:
19191919
app.use_rawinput = True
19201920

19211921
# Mock PromptSession.prompt (used when isatty=False)
1922-
# and app.session.prompt (used when use_rawinput=True and isatty=True)
1922+
# Also mock patch_stdout to prevent it from attempting to access the Windows console buffer in a Windows test environment
19231923
with (
19241924
mock.patch('cmd2.cmd2.PromptSession.prompt', return_value=input_str),
1925+
mock.patch('cmd2.cmd2.patch_stdout'),
19251926
):
19261927
# isatty is True
19271928
with mock.patch('sys.stdin.isatty', mock.MagicMock(name='isatty', return_value=True)):

0 commit comments

Comments
 (0)