Skip to content

Commit 2724718

Browse files
committed
add python test
1 parent 93d8e77 commit 2724718

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

python_files/tests/test_shell_integration.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import platform
33
import sys
44
from unittest.mock import Mock
5-
5+
import pytest
66
import pythonrc
77

88
is_wsl = "microsoft-standard-WSL" in platform.release()
@@ -61,3 +61,18 @@ def test_excepthook_call():
6161

6262
hooks.my_excepthook("mock_type", "mock_value", "mock_traceback")
6363
mock_excepthook.assert_called_once_with("mock_type", "mock_value", "mock_traceback")
64+
65+
def test_print_statement_darwin(monkeypatch):
66+
monkeypatch.setattr(sys, 'platform', 'darwin')
67+
with monkeypatch.context() as m:
68+
m.setattr('builtins.print', Mock())
69+
importlib.reload(sys.modules['pythonrc'])
70+
print.assert_any_call("Cmd click to launch VS Code Native REPL")
71+
72+
73+
def test_print_statement_non_darwin(monkeypatch):
74+
monkeypatch.setattr(sys, 'platform', 'win32')
75+
with monkeypatch.context() as m:
76+
m.setattr('builtins.print', Mock())
77+
importlib.reload(sys.modules['pythonrc'])
78+
print.assert_any_call("Ctrl click to launch VS Code Native REPL")

0 commit comments

Comments
 (0)