Bug Report
If the first 2 entries of sys.path are pwd, mypy seems to miss type checks in imported modules.
To Reproduce
mypy==0.971
# sscce.py
import sys
import mypy.api
sys.path.insert(0, sys.path[0])
print(mypy.api.run(["good.py"])[0])
Expected Behavior
bad.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
Found 1 error in 1 file (checked 1 source file)
Actual Behavior
Success: no issues found in 1 source file
Your Environment
This issue broke pytest-mypy tests which use pytester.runpytest_subprocess to run pytest in a subprocess (see realpython/pytest-mypy#139).
Bug Report
If the first 2 entries of
sys.pathare pwd,mypyseems to miss type checks in imported modules.To Reproduce
mypy==0.971Expected Behavior
Actual Behavior
Your Environment
This issue broke
pytest-mypytests which usepytester.runpytest_subprocessto runpytestin a subprocess (see realpython/pytest-mypy#139).