Skip to content

Commit 88ceee1

Browse files
authored
Merge pull request #81 from 56kyle/release/0.2.2
Release/0.2.2
2 parents a1d337a + 16d6112 commit 88ceee1

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pytest-static"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
description = "pytest-static"
55
authors = ["Kyle Oliver <56kyleoliver@gmail.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)