a pytest plugin to tag tests
Project description
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
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
- It is thread-safe, so it can be used with pytest-parallel
--tests-per-worker
option.
Project details
Release history Release notifications | RSS feed
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.1.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for pytest_tagging-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97069029a47d3b9632bdb93a2890b76ab9b0194afa67004211da45d8de6ece7e |
|
MD5 | 4dbf02a7bcc2b1415f9fddc199c785e9 |
|
BLAKE2b-256 | 6c6be92a83acff5fe243e2d156adf2981f590bf177134b6e1d8c281e62f43cc7 |