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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_typing_runner-0.6.1.tar.gz
.
File metadata
- Download URL: pytest_typing_runner-0.6.1.tar.gz
- Upload date:
- Size: 16.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf34294f82cec4fad4bd976b568451b059a450de44a2efba8a29027fc5aad3b9 |
|
MD5 | 8c0522342cb3161d38870177f5bdd238 |
|
BLAKE2b-256 | bf6334fa9294404aa42f4ef97086753d05495b24dcf75e4f0f22fb43bbdf2d81 |
File details
Details for the file pytest_typing_runner-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: pytest_typing_runner-0.6.1-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f946ee22b6ba41711524d4c8b2df20730e387df3ab5a1c5bc403f3aa3f6fbf1c |
|
MD5 | 65d21243dcc223da86c5cd287275c369 |
|
BLAKE2b-256 | 6bd81cf8d123ce3db47907c1995395a227501d64781ee9d02ed948a8b461d0d2 |