Skip to main content

Run the mypy static type checker as a pytest test case

Project description

pytest-mypy-runner

Run the mypy static type checker as a pytest test case

Usage

After adding this library to your dev/test dependencies and installing, add the following file to your test folder:

test_mypy.py

from pytest_mypy_runner import test_mypy  # noqa

Pytest should then pick up the test_mypy test.

Note: The # noqa is there to prevent formatters/linters like autoflake from removing what otherwise appears to be an unused import.

Configuration

The nearest pyproject.toml file will be used to configured mypy, traversing upward from the folder where test_mypy.py resides. Add any custom configuration to the [tool.mypy] section.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_mypy_runner-1.0.0.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

pytest_mypy_runner-1.0.0-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page