Skip to content

Exempt test modules from mypy return type annotation requirement#201

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/change-mypy-config-for-tests
Draft

Exempt test modules from mypy return type annotation requirement#201
Copilot wants to merge 2 commits intomainfrom
copilot/change-mypy-config-for-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 3, 2026

Test functions under tests/**/test_*.py don't need -> None return type annotations — they're not part of the public API and aren't shipped in the package. Adding them everywhere is pure noise.

Changes

  • mypy.ini: Adds a [mypy-tests.*] per-module override that disables the no-untyped-def error code for test modules, so projects using this skeleton no longer need to annotate every test function's return type.
[mypy-tests.*]
# Tests don't need return type annotations
disable_error_code =
    no-untyped-def,

Copilot AI linked an issue May 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update mypy configuration to exempt test return type declarations Exempt test modules from mypy return type annotation requirement May 3, 2026
Copilot AI requested a review from jaraco May 3, 2026 23:31
Copilot finished work on behalf of jaraco May 3, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid need for return type declarations in tests

2 participants