Skip to content

Commit 72b0f83

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 316c13b + 01153f4 commit 72b0f83

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,38 @@
2121
[pre-commit]: https://github.com/pre-commit/pre-commit
2222
[black]: https://github.com/psf/black
2323

24-
## Features
24+
## Overview
2525

26-
- TODO
26+
pytest-static is a pytest plugin that allows you to parametrize your tests using type annotations.
27+
28+
What this looks like in practice is that you can write a test like this:
29+
30+
```python
31+
import pytest
32+
from typing import Tuple
33+
34+
35+
@pytest.mark.parametrize_types("a", [Tuple[bool, bool]])
36+
def test_a(a: bool) -> None:
37+
assert isinstance(a, bool)
38+
```
39+
40+
Which would be equivalent to the following test
41+
42+
```python
43+
import pytest
44+
45+
46+
@pytest.mark.parametrize("a", [(True, True), (True, False), (False, True), (False, False)])
47+
def test_a(a: int) -> None:
48+
assert isinstance(a, int)
49+
```
50+
51+
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
52+
53+
However, you can also override these defaults if you wish by passing an instance of Config with some custom handlers set.
54+
55+
## Features
2756

2857
## Requirements
2958

0 commit comments

Comments
 (0)