Skip to content

Commit

Permalink
[suggest] Use realpath to canonicalize path in test (#7526)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
msullivan committed Sep 18, 2019
1 parent 61cdc95 commit 85b04c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/test/testfinegrained.py
Expand Up @@ -290,7 +290,7 @@ def maybe_suggest(self, step: int, server: Server, src: str, tmp_dir: str) -> Li
if json:
# JSON contains already escaped \ on Windows, so requires a bit of care.
val = val.replace('\\\\', '\\')
val = val.replace(tmp_dir + os.path.sep, '')
val = val.replace(os.path.realpath(tmp_dir) + os.path.sep, '')
output.extend(val.strip().split('\n'))
return normalize_messages(output)

Expand Down

0 comments on commit 85b04c1

Please sign in to comment.