Skip to content
3 changes: 2 additions & 1 deletion mypy/test/config.py
Original file line number Diff line number Diff line change
@@ -1,12 +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__))
this_file_dir = (Path(__file__)).resolve().parent
PREFIX = os.path.dirname(os.path.dirname(this_file_dir))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can also use .parent. Maybe you'll need to do str(...) to make sure it's a string path at the end, though...

On the other hand, maybe it would be nice to replace all os.path with pathlib.Path native things in this file? Up to you!


# Location of test data files such as test case descriptions.
Expand Down