Skip to content

Commit 7b00e95

Browse files
committed
fix
1 parent ae09a31 commit 7b00e95

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

python_files/tests/test_shell_integration.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,16 @@ def test_excepthook_call():
6161
hooks.my_excepthook("mock_type", "mock_value", "mock_traceback")
6262
mock_excepthook.assert_called_once_with("mock_type", "mock_value", "mock_traceback")
6363

64-
def test_print_statement_darwin(monkeypatch):
65-
importlib.reload(pythonrc)
66-
with monkeypatch.context() as m:
67-
m.setattr(sys, "platform", "darwin")
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-
def test_print_statement_non_darwin(monkeypatch):
73-
importlib.reload(pythonrc)
74-
with monkeypatch.context() as m:
75-
m.setattr(sys, "platform", "win32")
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")
64+
if sys.platform == "darwin":
65+
def test_print_statement_darwin(monkeypatch):
66+
importlib.reload(pythonrc)
67+
with monkeypatch.context() as m:
68+
m.setattr("builtins.print", Mock())
69+
print.assert_any_call("Cmd click to launch VS Code Native REPL")
70+
71+
if sys.platform == "win32":
72+
def test_print_statement_non_darwin(monkeypatch):
73+
importlib.reload(pythonrc)
74+
with monkeypatch.context() as m:
75+
m.setattr('builtins.print', Mock())
76+
print.assert_any_call("Ctrl click to launch VS Code Native REPL")

0 commit comments

Comments
 (0)