- Notifications
You must be signed in to change notification settings - Fork33
Mypy static type checker plugin for Pytest
License
realpython/pytest-mypy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Mypy static type checker plugin for pytest
- Runs the mypy static type checker on your source files as part of your pytest test runs.
- Does formypy what thepytest-flake8 plugin does forflake8.
- This is a work in progress – pull requests appreciated.
You can install "pytest-mypy" viapip fromPyPI:
$ pip install pytest-mypy
You can enable pytest-mypy with the--mypy
flag:
$ py.test --mypy test_*.py
Mypy supportsreading configuration settings from amypy.ini
file.Alternatively, the plugin can be configured in aconftest.py
to invoke mypy with extra options:
defpytest_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 theMIT license, "pytest-mypy" is free and open source software
If you encounter any problems, pleasefile an issue along with a detailed description.
Daniel Bader –@dbader_org –https://dbader.org –mail@dbader.org
About
Mypy static type checker plugin for Pytest
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.