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.6.0.tar.gz (11.6 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.6.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-mypy-0.6.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for pytest-mypy-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ea5da19d7343d4ccd98c3fe39cc30dee2743b9fbf00999b2a863e3ead78e353c
MD5 42e06648ca0d3e97a022bb730a4a0c53
BLAKE2b-256 036ea1e44bec71882dadff18c61f693e91c281768f362509dc6f5f6406cb7540

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_mypy-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for pytest_mypy-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f55dfbdd9e6749f5af3896e8ad813b611c3acadcec16ba728738777ccf9ce1d4
MD5 b42fb124f66694e572ee5319653a371c
BLAKE2b-256 037f87854180a391f9f8778830f6b06a861c535ca835a95d08a80571e46caed0

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