Mypy static type checker plugin for Pytest
Project description
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.
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_org – https://dbader.org – mail@dbader.org
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_mypy-0.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2505fcf61f1c0c51f950d4623ea8ca2daf6fb2101a5603554bad2e130202083 |
|
MD5 | 57c858a87803e78628a8d22466b2be79 |
|
BLAKE2-256 | 3279972e1ea7f392d2dd7214efba13fa40c47c4fce64f73578c0f1a380906242 |