diff --git a/mypy/test/config.py b/mypy/test/config.py index 2dc4208b1e9d..2a1aa461bfdc 100644 --- a/mypy/test/config.py +++ b/mypy/test/config.py @@ -1,13 +1,13 @@ from __future__ import annotations import os.path +from pathlib import Path provided_prefix = os.getenv("MYPY_TEST_PREFIX", None) if provided_prefix: PREFIX = provided_prefix else: - this_file_dir = os.path.dirname(os.path.realpath(__file__)) - PREFIX = os.path.dirname(os.path.dirname(this_file_dir)) + PREFIX = str(Path(__file__).absolute().parent.parent.parent) # Location of test data files such as test case descriptions. test_data_prefix = os.path.join(PREFIX, "test-data", "unit")