Metadata-Version: 2.4
Name: pytest-mypy
Version: 1.0.1
Summary: A Pytest Plugin for Mypy
Maintainer-email: David Tucker <david@tucker.name>
License: The MIT License (MIT)
        
        Copyright (c) 2016 Daniel Bader
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Project-URL: homepage, https://github.com/realpython/pytest-mypy
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: filelock>=3.0
Requires-Dist: mypy>=1.0
Requires-Dist: pytest>=7.0
Dynamic: license-file

pytest-mypy
===================================

Mypy static type checker plugin for pytest

.. image:: https://img.shields.io/pypi/v/pytest-mypy.svg
   :target: https://pypi.org/project/pytest-mypy/
   :alt: 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`_:

.. code-block:: bash

    $ pip install pytest-mypy

Usage
-----

You can enable pytest-mypy with the ``--mypy`` flag:

.. code-block:: bash

    $ py.test --mypy test_*.py

Mypy supports `reading configuration settings <http://mypy.readthedocs.io/en/latest/config_file.html>`_ from a ``mypy.ini`` file.
Alternatively, the plugin can be configured in a ``conftest.py`` to invoke mypy with extra options:

.. code-block:: python

    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:

.. code-block:: bash

    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

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


.. _`MIT`: http://opensource.org/licenses/MIT
.. _`file an issue`: https://github.com/realpython/pytest-mypy/issues
.. _`pip`: https://pypi.python.org/pypi/pip/
.. _`PyPI`: https://pypi.python.org/pypi
.. _`mypy`: http://mypy-lang.org/
.. _`pytest-flake8`: https://pypi.python.org/pypi/pytest-flake8
.. _`flake8`: https://pypi.python.org/pypi/flake8
.. _`@dbader_org`: https://twitter.com/dbader_org
