Skip to content

Commit

Permalink
attempting to fix wrongly caches monkeypatch
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed Jan 22, 2025
1 parent c053215 commit ae09a31
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python_files/tests/test_shell_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,17 @@ def test_excepthook_call():
mock_excepthook.assert_called_once_with("mock_type", "mock_value", "mock_traceback")

def test_print_statement_darwin(monkeypatch):
importlib.reload(pythonrc)
with monkeypatch.context() as m:
m.setattr(sys, 'platform', 'darwin')
m.setattr('builtins.print', Mock())
importlib.reload(sys.modules['pythonrc'])
m.setattr(sys, "platform", "darwin")
m.setattr("builtins.print", Mock())
importlib.reload(sys.modules["pythonrc"])
print.assert_any_call("Cmd click to launch VS Code Native REPL")


def test_print_statement_non_darwin(monkeypatch):
importlib.reload(pythonrc)
with monkeypatch.context() as m:
m.setattr(sys, 'platform', 'win32')
m.setattr(sys, "platform", "win32")
m.setattr('builtins.print', Mock())
importlib.reload(sys.modules['pythonrc'])
importlib.reload(sys.modules["pythonrc"])
print.assert_any_call("Ctrl click to launch VS Code Native REPL")

0 comments on commit ae09a31

Please sign in to comment.