Skip to main content

Run type checkers on specified test files

Project description


this is a plugin for pytest that allows you to create tests that verify how a type checker responds to your code.

This currently supports these type checkers:

  • pyright
  • mypy

File name format

this plugin looks for files starting with test and ending with or for example

global xfail

if you want to mark the hole test as xfail end it with, for example.


x: 123 = "abc"
y: str = 123

Only run specific checkers

if you include the name of a checker with _ around it only those checkers will be run. for example

xfail specific checkers

if you provide a x before the checker name, it will be run in xfail mode. for example will run all checkers, but mark the mypy one as xfail

if you only want to run mypy and have it be xfail use this workaround:

this can be combined, for example will run only pyright and mypy, but run mypy in xfail mode.

dont run specific checkers

if you provide a n before the checker name, it will not be run. for example will run all checkers, except 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_typechecker-0.3.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pytest_typechecker-0.3.3-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

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