Skip to content

Commit 4324d2c

Browse files
authored
Merge pull request #162 from 56kyle/release/1.0.1
Release/1.0.1
2 parents c42d18e + 6e0b11d commit 4324d2c

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,36 @@
1919
[pre-commit]: https://github.com/pre-commit/pre-commit
2020
[black]: https://github.com/psf/black
2121

22+
## Overview
23+
24+
pytest-static is a pytest plugin that allows you to parametrize your tests using type annotations.
25+
26+
What this looks like in practice is that you can write a test like this:
27+
28+
```python
29+
import pytest
30+
31+
32+
@pytest.mark.parametrize_types("a", [tuple[bool, bool]])
33+
def test_a(a: bool) -> None:
34+
assert isinstance(a, bool)
35+
```
36+
37+
Which would be equivalent to the following test
38+
39+
```python
40+
import pytest
41+
42+
43+
@pytest.mark.parametrize("a", [(True, True), (True, False), (False, True), (False, False)])
44+
def test_a(a: int) -> None:
45+
assert isinstance(a, int)
46+
```
47+
48+
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
49+
50+
These premade sets can be modified or added to using the type_handlers.register decorator, or the type_handlers.clear function.
51+
2252
## Features
2353

2454
- TODO

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pytest-static"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "pytest-static"
55
authors = ["Kyle Oliver <56kyleoliver@gmail.com>"]
66
license = "MIT"
@@ -37,6 +37,7 @@ typing-extensions = "^4.9.0"
3737
Pygments = ">=2.10.0"
3838
bandit = ">=1.7.4"
3939
black = ">=21.10b0"
40+
certifi = ">=2024.7.4"
4041
coverage = {extras = ["toml"], version = ">=6.2"}
4142
darglint = ">=1.8.1"
4243
flake8 = ">=4.0.1"

0 commit comments

Comments
 (0)