pytest-mypy 0.3.2


pip install pytest-mypy==0.3.2

Project Links

Meta
Author: Daniel Bader
Maintainer: Daniel Bader

Classifiers

Development Status
  • 4 - Beta

Framework
  • Pytest

Intended Audience
  • Developers

Topic
  • Software Development :: Testing

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.4
  • Python :: 3.5
  • Python :: 3.6
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Operating System
  • OS Independent

License
  • OSI Approved :: MIT License
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

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
pytest (>=2.9.2)
mypy (~=0.570)