Skip to main content

Mypy static type checker plugin for Pytest

Project description

Mypy static type checker plugin for pytest

See Latest Release on PyPI

Features

  • Runs the mypy static type checker on your source files as part of your pytest test runs.

  • Does for mypy what the pytest-flake8 plugin does for flake8.

  • This is a work in progress – pull requests appreciated.

Installation

You can install “pytest-mypy” via pip from PyPI:

$ pip install pytest-mypy

Usage

You can enable pytest-mypy with the --mypy flag:

$ py.test --mypy test_*.py

Mypy supports reading configuration settings from a mypy.ini file. Alternatively, the plugin can be configured in a conftest.py to invoke mypy with extra options:

def pytest_configure(config):
    plugin = config.pluginmanager.getplugin('mypy')
    plugin.mypy_argv.append('--check-untyped-defs')

You can restrict your test run to only perform mypy checks and not any other tests by using the -m option:

py.test --mypy -m mypy test_*.py

License

Distributed under the terms of the MIT license, “pytest-mypy” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Meta

Daniel Bader – @dbader_orghttps://dbader.orgmail@dbader.org

https://github.com/dbader/pytest-mypy

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-0.9.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_mypy-0.9.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-mypy-0.9.0.tar.gz.

File metadata

  • Download URL: pytest-mypy-0.9.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pytest-mypy-0.9.0.tar.gz
Algorithm Hash digest
SHA256 4f2a08d4ff34737eb6ad6402df1e424f43c9213181b32d675e4e3cafbda67bbd
MD5 d41f5308a89da7ccf5d937b0648147f1
BLAKE2b-256 89d51f9aa7daa2dc2de28bfbfd265308574a6b822c32f28c4db20e03ccc6adad

See more details on using hashes here.

File details

Details for the file pytest_mypy-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_mypy-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pytest_mypy-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8b5c6be405c8605959d1c79f20dcdeb2b3667fce8f264ff32bc854e5249f161
MD5 5284c0334483b4dccd20ca5b4f2b551e
BLAKE2b-256 dd0810e6a309708ae279c81ebae49bb0a77a716d5d735d10469ff2d47c6c7dc4

See more details on using hashes here.

Supported by

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