Skip to main content

pytest-static

PyPI Status Python Version License

Read the documentation at https://pytest-static.readthedocs.io/ Tests Codecov

pre-commit Black

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.

Release files for pytest-static 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-static 1.1.1
File Size Uploaded
pytest_static-1.1.1.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-static 1.1.1
File Interpreter ABI Platform
pytest_static-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / pytest_static-1.1.1.tar.gz

Download URL pytest_static-1.1.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b6fa88d5ad5d95b20e8b25f6dfa984c9f9ab6b4c570844c9e476e4c900a2cc59
BLAKE2b-256 checksum
How to use checksums
6b3c95d61ca3a02f556dc4c5185693f7d8894f7335f09f6a776eee35f6943d5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.10.5 Windows/10

Release files / pytest_static-1.1.1-py3-none-any.whl

Download URL pytest_static-1.1.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8012e3a29ff34d089a993fc8112c6866fb51786673c4e015b731e6cd7775a89
BLAKE2b-256 checksum
How to use checksums
feac8411c778fd256e82213e719ad8f351bd754c6e680d469f1fbb265f17cc9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.10.5 Windows/10

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page