Open intgr opened 11 months ago
Passing the option --mypy-only-local-stub
fixes this issue, eg:
pytest --mypy-only-local-stub tests/mypy/
I would argue this behavior should be the default. It's more useful and it's the default in Mypy, after all.
Should the pytest --mypy-only-local-stub
be mentioned in CONTRIBUTING.md
? Or the flag defined in pytest.ini
/mypy.ini
?
Mypy by default silences all errors that come from installed third party packages in
site-packages
. This can be disabled with the--no-silence-site-packages
flag.However, they are not silenced in
pytest-mypy-plugins
tests and I don't see a way to enable that behavior.For example in https://github.com/typeddjango/djangorestframework-stubs/pull/480 I enabled
disallow_untyped_defs
anddisallow_incomplete_defs
options, but then I got mypy errors fromyaml-stubs
package:As a work-around, I can just suppress these in
mypy.ini