Skip to main content

image image image image build image CodeQL image

Pytest decorator for parametrizing tests with default iterables, providing alternative syntax for pytest.mark.parametrize.

Usage

Decorate tests with iterable default values. Other fixtures can still be used as normal.

functions

from parametrized import parametrized

@parametrized
def test(..., name=values):
    """test single parametrized arg with each value"""

@parametrized.zip
def test(name=values, name1=values1, ...):
    """test parametrized args with zipped values"""

@parametrized.product
def test(name=values, name1=values1, ...):
    """test parametrized args with cartesian product of values"""

Zip before and after example:

@pytest.mark.parametrize("test_input,expected", [
    ("3+5", 8),
    ("2+4", 6),
    ("6*9", 42),
])
def test_eval(test_input, expected):
    assert eval(test_input) == expected

@parametrized.zip
def test_eval(test_input=["3+5", "2+4", "6*9"], expected=[8, 6, 42]):
    assert eval(test_input) == expected

Product before and after example:

@pytest.mark.parametrize("x", [0, 1])
@pytest.mark.parametrize("y", [2, 3])
def test_foo(x, y):
    pass

@parametrized.product
def test_foo(x=[0, 1], y=[2, 3]):
    pass

pytest.param is supported for single values or .product.

fixtures

Parametrized fixtures which simply return their param.

fixture_name = parametrized.fixture(*params, **kwargs)

Before and after example:

@pytest.fixture(params=[0, 1], ids=["spam", "ham"])
def a(request):
    return request.param

a = parametrized.fixture(0, 1, ids=["spam", "ham"])

Installation

pip install pytest-parametrized

Tests

100% branch coverage.

pytest [--cov]

Metadata

Release files for pytest-parametrized 1.8

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-parametrized 1.8
File Size Uploaded
pytest_parametrized-1.8.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-parametrized 1.8
File Interpreter ABI Platform
pytest_parametrized-1.8-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / pytest_parametrized-1.8.tar.gz

Download URL pytest_parametrized-1.8.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1b2bb0a53f67e5cb45cb49f533ca17bf3c2f715042aaa6be940d5b9dc65effc7
BLAKE2b-256 checksum
How to use checksums
c4b26400be9ee0790233a0d7686bbb8a37c673ee3d7f70112bf33a198500e9e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

Release files / pytest_parametrized-1.8-py3-none-any.whl

Download URL pytest_parametrized-1.8-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aee789e09c89e82b09dfcfa8acb518b6354da169826d058da0152cd39fda0add
BLAKE2b-256 checksum
How to use checksums
d1d18a87c9fe89e9439a36d44c2d4aeee0cfdf10f61c7e074fcbcade0febb0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8 This release

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.2

2 release files

0.1

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