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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pytest_mypy_runner-1.0.0.tar.gz.

File metadata

  • Download URL: pytest_mypy_runner-1.0.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pytest_mypy_runner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6ebad924f92c0f6e3bbf6f840da13377d23118406179c84722293fdc996fc6f0
MD5 25adfd271d28c2da101ae15f453e6a51
BLAKE2b-256 8dfcda34c58d029d35b713676a0791cec40ad2e7e237e213ac6b32f9bdf4f792

See more details on using hashes here.

File details

Details for the file pytest_mypy_runner-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_mypy_runner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90cbdf07f12bce394a3d672e50cb851d1a109caccf5169ad65a737693b642b34
MD5 f235a9e364d4cb3b4f33c7e6de6c2c88
BLAKE2b-256 c40b88995957f6390d85b84fa76e181d9d31972403dcd68cf7c15c6617c4dfc8

See more details on using hashes here.

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