diff --git a/tests/basic/test_editor.py b/tests/basic/test_editor.py index 2c45eba6e..578ff927c 100644 --- a/tests/basic/test_editor.py +++ b/tests/basic/test_editor.py @@ -95,9 +95,10 @@ def test_pipe_editor_with_fake_editor(): import tempfile with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f: - f.write("""import sys -with open(sys.argv[0] + ".log", "w") as f: - f.write(" ".join(sys.argv[1:])) + log_path = f.name + ".log" + f.write(f"""import sys +with open("{log_path}", "w") as f: + f.write(" ".join(sys.argv)) """) script_path = f.name