Mypy static type checker plugin for pytest
You can install "pytest-mypy" via pip from PyPI:
$ pip install pytest-mypy
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
Distributed under the terms of the MIT license, "pytest-mypy" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.
Daniel Bader – @dbader_org – https://dbader.org – mail@dbader.org
https://github.com/realpython/pytest-mypy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4