Skip to main content

a pytest plugin to tag tests

Project description

tests PyPI version

pytest-tagging

pytest plugin that allows tagging tests using arbitrary strings.

It supports selecting only tests with a specific tag, and displays a counter of how many tests failed for each specific tag.

This package exists because doing all of this with pytest.mark is painful, since it requires registering marks, and you cannot use variables defined elsewhere easily.

Usage

@pytest.mark.tags("JIRA-XX", "integration", constants.COMPONENT_X)
def test_foo():
    assert False

Invocation:

pytest --tags integration --tags MY_COMPONENT_NAME

pytest-tagging-screenshot

By default, all tests that match at least one tag will be collected. To only select tests that have all the provided tags, use the option --tags-operand=AND, like so:

pytest --tags integration --tags MY_COMPONENT_NAME --tags-operand AND

Extra

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

pytest_tagging-1.2.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

pytest_tagging-1.2.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page