File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 22import platform
33import sys
44from unittest .mock import Mock
5-
5+ import pytest
66import pythonrc
77
88is_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" )
You can’t perform that action at this time.
0 commit comments