Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mypy static type checker plugin for Pytest

License

NotificationsYou must be signed in to change notification settings

realpython/pytest-mypy

Repository files navigation

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 formypy what thepytest-flake8 plugin does forflake8.
  • This is a work in progress – pull requests appreciated.

Installation

You can install "pytest-mypy" viapip fromPyPI:

$ pip install pytest-mypy

Usage

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

License

Distributed under the terms of theMIT license, "pytest-mypy" is free and open source software

Issues

If you encounter any problems, pleasefile an issue along with a detailed description.

Meta

Daniel Bader –@dbader_orghttps://dbader.orgmail@dbader.org

https://github.com/realpython/pytest-mypy

About

Mypy static type checker plugin for Pytest

Resources

License

Stars

Watchers

Forks

Contributors16

Languages


[8]ページ先頭

©2009-2025 Movatter.jp