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.
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_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
File details
Details for the file pytest-mypy-0.10.3.tar.gz
.
File metadata
- Download URL: pytest-mypy-0.10.3.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8458f642323f13a2ca3e2e61509f7767966b527b4d8adccd5032c3e7b4fd3db |
|
MD5 | c82c99676687851d68a2733369639954 |
|
BLAKE2b-256 | 853a318c91140f242cafff64ddac97d6999640bc3da9afbf37253475c2208e79 |
File details
Details for the file pytest_mypy-0.10.3-py3-none-any.whl
.
File metadata
- Download URL: pytest_mypy-0.10.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7638d0d3906848fc1810cb2f5cc7fceb4cc5c98524aafcac58f28620e3102053 |
|
MD5 | a0ca2c1158c62bd5927f12286aa853a3 |
|
BLAKE2b-256 | 240236a48da6d4168db8fb596c040680665bee89a7bced22ba1eee75920059c4 |