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.8.0.tar.gz (13.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.8.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-mypy-0.8.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.0

File hashes

Hashes for pytest-mypy-0.8.0.tar.gz
Algorithm Hash digest
SHA256 63d418a4fea7d598ac40b659723c00804d16a251d90a5cfbca213eeba5aaf01c
MD5 10a7817ab1c272b25bc6891bbb0c8d94
BLAKE2b-256 7482b959609cff29b3511bac3d4d2c5caf69305a7f78e32620629224050065cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_mypy-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.0

File hashes

Hashes for pytest_mypy-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d2112972c1debf087943f48963a0daf04f3424840aea0cf437cc97053b1b0ef
MD5 06a6f6c8c93e4f195315ec41fd8a56b0
BLAKE2b-256 ef09bba0bccfbf15cbca6ccdfaf9bcace9933f8e50bda5f8ca949a64cf985795

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