Skip to content

Commit 4716cce

Browse files
committed
fix: pre-calculate Windows paths to avoid f-string backslash issues
1 parent c67bbe6 commit 4716cce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/basic/test_coder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ def test_get_file_mentions_various_formats(self):
302302

303303
# Pre-format the Windows path to avoid backslash issues in f-string expressions
304304
windows_path = test_files[2].replace("/", "\\")
305+
win_path3 = test_files[3].replace('/', '\\')
305306

306307
for fname in test_files:
307308
fpath = Path(fname)
@@ -336,7 +337,7 @@ def test_get_file_mentions_various_formats(self):
336337
(
337338
f"First, edit `{test_files[0]}`. Then modify {test_files[1]}.\n"
338339
f"```js\n// Update this file\nconst file = '{test_files[2]}';\n```\n"
339-
f"Finally check {test_files[3].replace('/', '\\')}"
340+
f"Finally check {win_path3}"
340341
),
341342
{test_files[0], test_files[1], test_files[2], test_files[3]},
342343
),
@@ -347,7 +348,7 @@ def test_get_file_mentions_various_formats(self):
347348
{test_files[1], test_files[2]},
348349
),
349350
(
350-
f"The file **{test_files[3].replace('/', '\\')}** needs updating",
351+
f"The file **{win_path3}** needs updating",
351352
{test_files[3]},
352353
),
353354
(

0 commit comments

Comments
 (0)