pytest-mypy
A Pytest Plugin for Mypy
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a real workflow problem—integrating type checking into your existing pytest test runs. It's well-suited for teams that want type validation as a first-class part of their test suite rather than a separate tool invocation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires mypy and pytest to be installed; mypy configuration can be read from mypy.ini or set programmatically via conftest.py.
- Low friction install with three straightforward runtime dependencies (pytest, mypy, filelock).
- The package is actively maintained with recent commits and has been stable since its early releases.
License · maintenance · safety
permissive license (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2025-04-02 (499 days) · last repo commit 2026-06-13 · 256 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 557,278 downloads/mo, #6,011 on PyPI
Alternatives
Verify before relying
pip install pytest-mypy
py.test --mypy test_*.py
# Or configure in conftest.py:
def pytest_configure(config):
plugin = config.pluginmanager.getplugin('mypy')
plugin.mypy_argv.append('--check-untyped-defs')- Whether the plugin supports all mypy configuration options or only a subset
- Performance impact when running type checks on large codebases during test execution
What it is and what it does
pytest-mypy is a pytest plugin that runs mypy's static type checker on your source files as part of your normal pytest test runs. Instead of running type checks separately, you invoke mypy checks through pytest using the --mypy flag, making type validation part of your continuous test workflow.
The plugin works by integrating mypy into pytest's test discovery and execution, similar to how pytest-flake8 integrates flake8. You can configure mypy behavior through a mypy.ini file or programmatically in conftest.py, and you can filter test runs to only perform type checks using pytest's -m option. It depends on pytest, mypy, and filelock, all of which are common tools in Python development environments.
Use it for
- Run type checks automatically as part of your CI/CD pipeline without a separate mypy invocation step.
- Enforce type checking discipline in test suites by failing the build when type errors are detected.
- Configure mypy options per-project in conftest.py to apply custom type-checking rules during test runs.
- Restrict test execution to only type checks using pytest markers when you want to validate types without running functional tests.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a real workflow problem—integrating type checking into your existing pytest test runs. It's well-suited for teams that want type validation as a first-class part of their test suite rather than a separate tool invocation.
Install
pytest-mypy on PyPI
Before you install
Low friction install with three straightforward runtime dependencies (pytest, mypy, filelock). The package is actively maintained with recent commits and has been stable since its early releases.
Requires mypy and pytest to be installed; mypy configuration can be read from mypy.ini or set programmatically via conftest.py.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install pytest-mypy
py.test --mypy test_*.py
# Or configure in conftest.py:
def pytest_configure(config):
plugin = config.pluginmanager.getplugin('mypy')
plugin.mypy_argv.append('--check-untyped-defs')
Verify before relying
- Whether the plugin supports all mypy configuration options or only a subset
- Performance impact when running type checks on large codebases during test execution
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesfilelockmypypytest |
| Maintenance | Actively maintained 499 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 557,278 / month, #6,011 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Testing |
Evidence: pytest_mypy-1.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest mypy plugin”
- pytest-mypyIntegrates mypy static type checking into pytest, running type checks…
- pytest-mypy-pluginsA pytest plugin that runs type-checking tests against mypy by…
- pytest-enablerA pytest plugin that conditionally enables other pytest plugins based…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-flake8 · pytest-logger · pytest-datadir · mypy · pytest-logging · pytest-enabler · pytest-astropy-header · pytest-test-groups · pytest-progress · pytest-metadata