From 4716cce208e5b5586f11df3f57ba845143f7ac7e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 25 Mar 2025 11:05:49 -1000 Subject: [PATCH] fix: pre-calculate Windows paths to avoid f-string backslash issues --- tests/basic/test_coder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_coder.py b/tests/basic/test_coder.py index d62ab6b65..8e36cd134 100644 --- a/tests/basic/test_coder.py +++ b/tests/basic/test_coder.py @@ -302,6 +302,7 @@ class TestCoder(unittest.TestCase): # Pre-format the Windows path to avoid backslash issues in f-string expressions windows_path = test_files[2].replace("/", "\\") + win_path3 = test_files[3].replace('/', '\\') for fname in test_files: fpath = Path(fname) @@ -336,7 +337,7 @@ class TestCoder(unittest.TestCase): ( f"First, edit `{test_files[0]}`. Then modify {test_files[1]}.\n" f"```js\n// Update this file\nconst file = '{test_files[2]}';\n```\n" - f"Finally check {test_files[3].replace('/', '\\')}" + f"Finally check {win_path3}" ), {test_files[0], test_files[1], test_files[2], test_files[3]}, ), @@ -347,7 +348,7 @@ class TestCoder(unittest.TestCase): {test_files[1], test_files[2]}, ), ( - f"The file **{test_files[3].replace('/', '\\')}** needs updating", + f"The file **{win_path3}** needs updating", {test_files[3]}, ), (