Skip to main content

Mypy static type checker plugin for Pytest

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-mypy-0.6.2.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

pytest_mypy-0.6.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest-mypy-0.6.2.tar.gz.

File metadata

  • Download URL: pytest-mypy-0.6.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for pytest-mypy-0.6.2.tar.gz
Algorithm Hash digest
SHA256 2560a9b27d59bb17810d12ec3402dfc7c8e100e40539a70d2814bcbb27240f27
MD5 69ec6b6a6afe83ddb1163099d576b733
BLAKE2b-256 3250f7db881514b246b6cac1cb955786d97d03095cd7eca8531471be5ea47ca8

See more details on using hashes here.

Provenance

File details

Details for the file pytest_mypy-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: pytest_mypy-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for pytest_mypy-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76e705cfd3800bf2b534738e792245ac5bb8d780698d0f8cd6c79032cc5e9923
MD5 820c7f7dd7ffa4652df3649192b2c5db
BLAKE2b-256 a0f48c955b26f00b911e8731fdc382e261d0814c486f24b277f5a45a58ff2bb3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page