Add mypy excludes for collect_ignore entries
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- testing-qa
Research direction
Read the linked conftest.py to understand the collect_ignore entry, then reproduce the mypy-status failure in pytest-mypy using the reported example. Trace how ignored files are selected for mypy and verify that the ignored file is no longer checked while other sources still are.
Written by the indexing model from the issue text.
Description
The jaraco.site project has a file in the tree that's ignored for tests.
However, even with that configuration, the file gets collected and is run by mypy and causes tests to fail:
__________________________________________________________________ test session ___________________________________________________________________
mypy exited with status 1.
...
====================================================================== mypy =======================================================================
jaraco/site/projecthoneypot/croakysteel.py:528: error: "Callable[[Any, Any, Any, Any], Any]" has no attribute "getSettings" [attr-defined]
jaraco/site/projecthoneypot/croakysteel.py:529: error: "Callable[[Any, Any, Any, Any], Any]" has no attribute "makeHTML" [attr-defined]
jaraco/site/projecthoneypot/croakysteel.py:533: error: "Callable[[Any, Any, Any, Any], Any]" not callable [operator]
Found 3 errors in 1 file (checked 11 source files)
============================================================= short test summary info =============================================================
FAILED conftest.py::mypy-status
============================================== 1 failed, 25 passed, 10 skipped, 3 warnings in 5.09s ===============================================
py: exit 1 (5.43 seconds) /Users/jaraco/code/jaraco/jaraco.site> pytest pid=33733
Is there a way that pytest-mypy can honor collect_ignore?
- Dominant language
- Python
- Stars
- 257
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from realpython/pytest-mypy
-
integration
Difficulty 3/5 1-2 days Newbie friendliness 38/100
realpython/pytest-mypy#196 · 2 comments ·
-
realpython/pytest-mypy#190 · 1 comment · 1 assignee ·
-
integration
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
realpython/pytest-mypy#138 · 2 comments · 2 reactions ·
-
Expected mypy errors Open
realpython/pytest-mypy#105 · 4 comments · 1 assignee ·
-
reporting
Difficulty 5/5 Over a week Newbie friendliness 30/100
realpython/pytest-mypy#23 · 1 comment · 2 reactions ·
All issues in realpython/pytest-mypy
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100