Skip to content

Commit 8e6125f

Browse files
committed
Fix MacOS tmp path compatibility
1 parent 78c5b16 commit 8e6125f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mypy/test/test_config_parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ def set_strict_flags() -> None:
174174
assert strict_option_set is True
175175
assert options.ignore_missing_imports_per_module is True
176176
assert options.config_file == str(pyproject.name)
177-
assert os.environ["MYPY_CONFIG_FILE_DIR"] == str(pyproject.parent)
177+
# MacOS has some odd symlinks for tmp folder, resolve them to get the actual values
178+
assert os.environ["MYPY_CONFIG_FILE_DIR"] == os.path.realpath(pyproject.parent)
178179

179180
assert options.per_module_options["c"] == {
180181
"disable_error_code": [],
@@ -204,10 +205,11 @@ def test_extend_cyclic(self) -> None:
204205
stderr = io.StringIO()
205206
parse_config_file(options, lambda: None, None, stdout, stderr)
206207

208+
# MacOS has some odd symlinks for tmp folder, resolve them to get the actual values
207209
assert stdout.getvalue() == ""
208210
assert stderr.getvalue() == (
209-
f"Circular extend detected: {pyproject}\n"
210-
f"../pyproject.toml is not a valid path to extend from {ini}\n"
211+
f"Circular extend detected: {os.path.realpath(pyproject)}\n"
212+
f"../pyproject.toml is not a valid path to extend from {os.path.realpath(ini)}\n"
211213
)
212214

213215
def test_extend_strict_override(self) -> None:

0 commit comments

Comments
 (0)