Skip to content

Commit ae09a31

Browse files
committed
attempting to fix wrongly caches monkeypatch
1 parent c053215 commit ae09a31

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

python_files/tests/test_shell_integration.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,17 @@ def test_excepthook_call():
6262
mock_excepthook.assert_called_once_with("mock_type", "mock_value", "mock_traceback")
6363

6464
def test_print_statement_darwin(monkeypatch):
65+
importlib.reload(pythonrc)
6566
with monkeypatch.context() as m:
66-
m.setattr(sys, 'platform', 'darwin')
67-
m.setattr('builtins.print', Mock())
68-
importlib.reload(sys.modules['pythonrc'])
67+
m.setattr(sys, "platform", "darwin")
68+
m.setattr("builtins.print", Mock())
69+
importlib.reload(sys.modules["pythonrc"])
6970
print.assert_any_call("Cmd click to launch VS Code Native REPL")
7071

71-
7272
def test_print_statement_non_darwin(monkeypatch):
73+
importlib.reload(pythonrc)
7374
with monkeypatch.context() as m:
74-
m.setattr(sys, 'platform', 'win32')
75+
m.setattr(sys, "platform", "win32")
7576
m.setattr('builtins.print', Mock())
76-
importlib.reload(sys.modules['pythonrc'])
77+
importlib.reload(sys.modules["pythonrc"])
7778
print.assert_any_call("Ctrl click to launch VS Code Native REPL")

0 commit comments

Comments
 (0)