Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add mypy excludes for collect_ignore entries

Open
#160 4 comments 0 reactions 0 assignees View on GitHub

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

integration

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from realpython/pytest-mypy

All issues in realpython/pytest-mypy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.