Skip to main content

Pytest plugin to make it easier to run and check python code against static type checkers

Project description

This is a plugin for pytest to assist in generating scenarios to run static type checking against.

History

This plugin comes out of a fork of the pytest_mypy_plugins pytest plugin for writing tests that pytest can use to run mypy against sets of files.

The difference for this plugin is that it provides a pytest fixture to do work from rather than exposing a yml interface for writing tests. It also allows for running mypy multiple times in the same test with changes to the code being statically type checked. And also has some different mechanisms for expressing the expected output from mypy.

Features

  • Provides pytest fixtures to help create scenarios for testing a type checker

  • Each scenario is a set of files and a set of expectations around the behaviour of the type checker

  • Scenarios may comprise of multiple runs of the type checker to check the behaviour of the type checker when changes are made against a warm cache

  • Possible to run the same tests with different “strategies” where a strategy is a combination of specific type checker and default arguments

  • Currently only supports mypy by default but should be possible to easily add more type checkers.

  • Adds the ability to create files using a syntax for representing expectations in both the style used by mypy tests and a format introduced by this project that in some ways is a bit clearer and more expressive.

Built Docs

https://pytest-typing-runner.readthedocs.io

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_typing_runner-0.6.2.tar.gz (20.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_typing_runner-0.6.2-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest_typing_runner-0.6.2.tar.gz.

File metadata

  • Download URL: pytest_typing_runner-0.6.2.tar.gz
  • Upload date:
  • Size: 20.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pytest_typing_runner-0.6.2.tar.gz
Algorithm Hash digest
SHA256 49aee633c6766ef6643e37486f9252694ba5bdc521b230cb4ec875cf30a97dd2
MD5 ae0ceb8837d79467a3e52f4c9a11895f
BLAKE2b-256 8734026d4c8490653fbf34d96c969fdc0f33c4883f0f09b4532398f31f2c5bc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_typing_runner-0.6.2.tar.gz:

Publisher: release.yml on delfick/pytest-typing-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for pytest_typing_runner-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94c0039a5f1cdc7f5b8995a62c4746cf18a23b67350e4cb629be5fe95ab90b5b
MD5 d2383df14d4f13bb4bae0af564927b2a
BLAKE2b-256 dc118a1cfb9c07b0ce6ef42d3c060defc4e2625fd947fb215963f97838721506

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_typing_runner-0.6.2-py3-none-any.whl:

Publisher: release.yml on delfick/pytest-typing-runner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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