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
from typing import Tuple
@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
However, you can also override these defaults if you wish by passing an instance of Config with some custom handlers set.
Features
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
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
Hashes for pytest_static-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e55d9d3d649cc1746518e3738784f97c968d1337dc8c0684e28ab1305260327 |
|
MD5 | 92d823612d84e53f4e2b3613cc00aa75 |
|
BLAKE2b-256 | 56dc13ec1d01edbeff5242d9edbfafc01ad6681799e837304d393fc90dad369c |