Skip to content

mypy: type-check tests and use pathlib fixtures - #2685

Merged
DanielNoord merged 1 commit into
PyCQA:mainfrom
DanielNoord:agents/remove-mypy-overrides-fix-errors
Sep 27, 2026
Merged

DanielNoord merged 1 commit into
PyCQA:mainfrom
DanielNoord:agents/remove-mypy-overrides-fix-errors

Conversation

@DanielNoord

@DanielNoord DanielNoord commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Remove the tests-specific mypy override and annotate test helpers and fixtures so the suite passes strict type checking.
  • Replace legacy tmpdir/tmpdir_factory fixtures and path operations with typed tmp_path/tmp_path_factory and pathlib APIs.

Validation

  • uv run mypy passes (86 source files).
  • uv run python -m compileall -q isort tests passes.
  • Ruff lint, Ruff formatting, and isort checks pass for all changed files.
  • uv run pytest tests/unit: 621 passed, 1 skipped, 1 failed. The existing test_isort_can_turn_off_import_adds_with_action_comment_issue_1737 failure expects a typing.Any import absent from the actual output.

This pull request is intentionally kept as a draft.

@DanielNoord DanielNoord changed the title mypy: type-check the test suite mypy: type-check tests and use pathlib fixtures Sep 27, 2026
@DanielNoord
DanielNoord force-pushed the agents/remove-mypy-overrides-fix-errors branch from c7aee1d to 14ef25c Compare September 27, 2026 15:16
@DanielNoord
DanielNoord force-pushed the agents/remove-mypy-overrides-fix-errors branch from 14ef25c to a64712a Compare September 27, 2026 15:18
@DanielNoord
DanielNoord marked this pull request as ready for review September 27, 2026 15:19
@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.41%. Comparing base (1fd0701) to head (a64712a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2685      +/-   ##
==========================================
- Coverage   99.44%   99.41%   -0.04%     
==========================================
  Files          41       41              
  Lines        3231     3231              
  Branches      690      690              
==========================================
- Hits         3213     3212       -1     
- Misses         11       12       +1     
  Partials        7        7              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DanielNoord
DanielNoord merged commit 0482160 into PyCQA:main Sep 27, 2026
41 of 43 checks passed
@DanielNoord
DanielNoord deleted the agents/remove-mypy-overrides-fix-errors branch September 27, 2026 15:33
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.

1 participant