-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mucking with sys.path breaks checking imports #13701
Comments
I bisected |
This is a mostly unavoidable side effect of #11143, which changed mypy to have full I'm curious if it's easy for you to work around? Note that if you explicitly ask to check bad.py you should get errors from it. Also note that there are many things you could do to sys.path that would make mypy.api.run very unhappy ;-) Also note that if we were to go back to the original #11143, mucking around with sys.path means you'd get inconsistent results between the equivalent of |
I will probably just xfail the test on any affected mypy versions. The test checks that the plugin behaves correctly when a type check fails in an imported module that wasn't collected by pytest, so checking bad.py directly wouldn't really make sense.
That's fair. I'm not sure why cwd ends up at the front of
Interesting, yes indeed. pytest-mypy only relies on |
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
Expected Behavior
Actual Behavior
Your Environment
This issue broke
pytest-mypy
tests which usepytester.runpytest_subprocess
to runpytest
in a subprocess (see realpython/pytest-mypy#139).The text was updated successfully, but these errors were encountered: