Skip to main content

pytest-uncollect-if

PyPI version Python versions See Build Status on GitHub Actions

A pytest plugin to uncollect tests based on a condition without the tests being included in the skipped for deselected report counts. This makes it easier use the Cartesian product of two different usages of pytest.mark.parametrize where you want to disable a specific combination.

This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.

Requirements

  • pytest > 6.2.0

For development requirements, run

pip install -r requirements-dev.txt

Installation

You can install “pytest-uncollect-if” via pip from PyPI

pip install pytest-uncollect-if

If you do not have autoload enabled, add the plugin to your top-level conftest.py

pytest_plugins = ("pytest_uncollect_if.plugin",)

Usage

The marker takes a single argument func which accepts parameters as **kwargs and returns a boolean value. If the return value is True, the test will be uncollected. To avoid fragile statements that fail on extra parameters, be sure to add **kwargs to your function signature.

param1_decorator = pytest.mark.parametrize("param1", [1, 2, 3, 4])
param2_decorator = pytest.mark.parametrize("param2", [1, 2, 3, 4])


# uncollect if param and param2 are equal
@pytest.mark.uncollect_if(func=lambda param1, param2, **kwargs: param1 == param2)
def test_uncollect_if(param1, param2):
    assert param != param2

A typed alias for pytest.mark.uncollect_if is available as uncollect_if

from pytest_uncollect_if import uncollect_if

param1_decorator = pytest.mark.parametrize("param1", [1, 2, 3, 4])
param2_decorator = pytest.mark.parametrize("param2", [1, 2, 3, 4])


# uncollect if param and param2 are equal
@uncollect_if(func=lambda param1, param2, **kwargs: param1 == param2)
def test_uncollect_if(param1, param2):
    assert param != param2

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, “pytest-uncollect-if” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Metadata

Release files for pytest-uncollect-if 0.1.4

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-uncollect-if 0.1.4
File Size Uploaded Provenance
pytest_uncollect_if-0.1.4.tar.gz 6.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-uncollect-if 0.1.4
File Interpreter ABI Platform
pytest_uncollect_if-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / pytest_uncollect_if-0.1.4.tar.gz

Download URL pytest_uncollect_if-0.1.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a914ba1ad5debb8b689d2147e88afbf308387151a07544e8bc0958c814e141a5
BLAKE2b-256 checksum
How to use checksums
dff7005ccf7f82d1ffe6c3eff70a4029d387613f03b842028c0f481d969dbfd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 1, 2026.

Transparency log

Release files / pytest_uncollect_if-0.1.4-py3-none-any.whl

Download URL pytest_uncollect_if-0.1.4-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c94f5239c5df009fbc6a4140138d984edd50fb5831745a0ed1f73b94bb409e8
BLAKE2b-256 checksum
How to use checksums
4c798350be059ec5aeaad58f34f4554c2cae91bb5543a1d5e50489b795918a75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 1, 2026.

Transparency log

Security for pytest-uncollect-if 0.1.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytest_uncollect_if-0.1.4.tar.gz

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 Sep 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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