pytest-mypy 0.6.1


pip install pytest-mypy==0.6.1

Project Links

Meta
Author: Daniel Bader
Maintainer: David Tucker
Requires Python: ~=3.4

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 :: 3.7
  • Python :: 3.8
  • Python :: Implementation :: CPython

Operating System
  • OS Independent

License
  • OSI Approved :: MIT License

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

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
filelock (>=3.0)
pytest (<4.7,>=3.5)
mypy (<0.700,>=0.500)
pytest (>=3.5)
mypy and (>=0.500)
mypy (>=0.700)