Skip to content

Commit 85b04c1

Browse files
authored
[suggest] Use realpath to canonicalize path in test (#7526)
The tmp_dir we computed and the real path that was showing up in the output didn't match on OS X in the testSuggestColonMethodJSON test. Use realpath to fix the issue.
1 parent 61cdc95 commit 85b04c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/test/testfinegrained.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def maybe_suggest(self, step: int, server: Server, src: str, tmp_dir: str) -> Li
290290
if json:
291291
# JSON contains already escaped \ on Windows, so requires a bit of care.
292292
val = val.replace('\\\\', '\\')
293-
val = val.replace(tmp_dir + os.path.sep, '')
293+
val = val.replace(os.path.realpath(tmp_dir) + os.path.sep, '')
294294
output.extend(val.strip().split('\n'))
295295
return normalize_messages(output)
296296

0 commit comments

Comments
 (0)