pytest-static
Project description
pytest-static
Overview
pytest-static is a pytest plugin that allows you to parametrize your tests using type annotations.
What this looks like in practice is that you can write a test like this:
import pytest
@pytest.mark.parametrize_types("a", [tuple[bool, bool]])
def test_a(a: bool) -> None:
assert isinstance(a, bool)
Which would be equivalent to the following test
import pytest
@pytest.mark.parametrize("a", [(True, True), (True, False), (False, True), (False, False)])
def test_a(a: int) -> None:
assert isinstance(a, int)
For types such as int, str, etc that have an unlimited amount of values, there are premade sets meant to cover common edge cases that are used by default
These premade sets can be modified or added to using the type_handlers.register decorator, or the type_handlers.clear function.
Features
- TODO
Requirements
- TODO
Installation
You can install pytest-static via pip from PyPI:
$ pip install pytest-static
Usage
Please see the Command-line Reference for details.
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the MIT license, pytest-static is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.
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_static-1.1.0.tar.gz
.
File metadata
- Download URL: pytest_static-1.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9a954a318a806451fa725f3d0bd5c91a0cba8d60f99bffc6e6c425819643a6 |
|
MD5 | 28cd558eadf4da841dbb5a7fd4516653 |
|
BLAKE2b-256 | 4c87db3b9bfb554196bddd6e8c0c2f370e27140e2cbf7a6920b419b78188fcee |
File details
Details for the file pytest_static-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_static-1.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24098d4dc1c4ed22e5adaf5f540ebe07cb56c28b770ac0f784b30d11bd278ef4 |
|
MD5 | 2fce06f3a6cd32ad16be93884f1a6fc4 |
|
BLAKE2b-256 | a9ae664458977b6083e42745d4a40fe324c204c66c430f54f4930b5dcee477f4 |