Skip to main content

Mypy static type checker plugin for Pytest

Project description

See Build Status on Travis CI See Latest Release on PyPI

Mypy static type checker plugin for Pytest


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. This is currently the only way to configure mypy through pytest-mypy. In the future pytest-mypy may offer a passthrough for command line options.

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

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

Development Environment Setup

Here’s how to install pytest-mypy in development mode so you can test your changes locally:

$ pyvenv venv
$ source venv/bin/activate
$ python setup.py develop
$ venv/bin/py.test --mypy example_test.py

How to publish a new version to PyPI

$ pip install twine wheel
$ python setup.py sdist bdist_wheel
$ twine upload dist/*

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

Uploaded Source

Built Distribution

pytest_mypy-0.3.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pytest-mypy-0.3.2.tar.gz
Algorithm Hash digest
SHA256 acc653210e7d8d5c72845a5248f00fd33f4f3379ca13fe56cfc7b749b5655c3e
MD5 8f89c308ab967778e5a34896cfb5994c
BLAKE2b-256 7ba683c9ea93898b4c3ede00bd0ff3fb5cddff29032a0b72e9b92ff3eb224698

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pytest_mypy-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f6436eed8118afd6c10a82b3b60fb537336736b0fd7a29262a656ac42ce01ac
MD5 7d406f88f246c38b905229f58346c0ed
BLAKE2b-256 32919458f3099491b3d1a5b84c4d59f4b6064c5d013bab3c5a12f283f1fb7a96

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