This is a pytest plugin that adds the ability to filter test cases by
associated tier.
It adds:
@pytest.mark.tier(number)mark to associate test case with given tier--tiercommand line option to filter out test cases that are not associated with selected tier(s)
-
Enable plugin in conftest.py
pytest_plugins = ( "pytest_tier", )
-
Define test with tier mark
@pytest.mark.tier(0) def test_tier(): pass
-
Run pytest with tier filter
$ pytest --tier=0
The tier mark takes single integer as an argument.
@pytest.mark.tier(int)
You can filter tests using the --tier option, which takes the desired tier as
an argument. This option can be passed multiple times.
pytest --tier=0 --tier=1 ...