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

Uploaded Source

Built Distribution

pytest_mypy-0.10.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-mypy-0.10.1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.14

File hashes

Hashes for pytest-mypy-0.10.1.tar.gz
Algorithm Hash digest
SHA256 7fe68837449334553e224cc86c6dc1b938772399abb64f510a864fb209593a94
MD5 13deb5249ff6cc9d44902c39ecba5098
BLAKE2b-256 9f98dc090f6236ed859e496bd04aacfa8dc3cd5ccc80aa2f64f7b8c56afaaf23

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pytest_mypy-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecf541a28df9e5f992936a1613bee231957df2d40efa662cd7c52ace2e64f43f
MD5 e50e57a45e8018e3b138bac20fc28a04
BLAKE2b-256 924c7e486b2b3dff423030cb5323cb4d97e363cff5643edf9227b163b29ebce2

See more details on using hashes here.

Provenance

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