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.3.tar.gz (253.7 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.3.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-mypy-0.3.3.tar.gz
  • Upload date:
  • Size: 253.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3

File hashes

Hashes for pytest-mypy-0.3.3.tar.gz
Algorithm Hash digest
SHA256 917438af835beb87f14c9f6261137f8e992b3bf87ebf73f836ac7ede03424a0f
MD5 cfa580a806d3a9f4f6711eb26880f26e
BLAKE2b-256 64b6ce644276f3d47f74322b412c36ed5d60136d6ffbc4511e588f9d44527ea4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_mypy-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3

File hashes

Hashes for pytest_mypy-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 419d1d4877d41a6a80f0eb31faa7c50bb9445557f7ff1b02a1a26d10d7dc7691
MD5 a0db47ab3c30caa858f3c4df6dd5004f
BLAKE2b-256 ada6363c8823fcc31ee3e26b9ade5a7697ebdd8f5478f6c7b0516ea669d72e92

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