Skip to main content

pytest plugin for writing tests for mypy plugins

Project description

mypy logo

PyTest plugin for testing mypy custom plugins

Build Status Checked with mypy

Examples of a test case:

-   case: request_object_has_user_of_type_auth_user_model
    disable_cache: true
    main: |
        from django.http.request import HttpRequest
        reveal_type(HttpRequest().user)  # N: Revealed type is 'myapp.models.MyUser'
        # check that other fields work ok
        reveal_type(HttpRequest().method)  # N: Revealed type is 'Union[builtins.str, None]'
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models
                class MyUser(models.Model):
                    pass

Options:

mypy-tests:
  --mypy-testing-base=MYPY_TESTING_BASE
                        Base directory for tests to use
  --mypy-ini-file=MYPY_INI_FILE
                        Which .ini file to use as a default config for tests
  --mypy-same-process 
                        Now, to help with various issues in django-stubs, it runs every single test in the subprocess mypy call. 
                        Some debuggers cannot attach to subprocess, so enable this flag to make mypy check happen in the same process.
                        (Could cause cache issues)

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-plugins-1.0.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

pytest_mypy_plugins-1.0.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest-mypy-plugins-1.0.2.tar.gz.

File metadata

  • Download URL: pytest-mypy-plugins-1.0.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for pytest-mypy-plugins-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0b7ae82348eefa2a5fd3b52f981166cc826a0bb5495c4c4645a493874045f28a
MD5 c7a5673826cde90ae5f1055288e32ddc
BLAKE2b-256 0fe109ec74b833baa36d75b734bc1ad0a87f2f828bea571da6ef2b768f0642ae

See more details on using hashes here.

File details

Details for the file pytest_mypy_plugins-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pytest_mypy_plugins-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for pytest_mypy_plugins-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b61cc947bda93dc34f6b563643af48098c21248eb9d10b56d328b6785f88abed
MD5 4c971607151d2b1ebd63c0605c866b54
BLAKE2b-256 5eba0afa708e40aa93bfd6065f72593ab35256f21b885d790cdbd5706e1d495b

See more details on using hashes here.

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