Use Pytest marks to filter or skip tests
masterSince version 0.11.0, you can use marks in your Tavern YAML files to interact with Pytest. Marks allow you to:
- Filter tests via CLI: Select specific tests to run using
py.test -m "<mark_name>"or exclude them usingpy.test -m "not <mark_name>". - Skip tests: Use the
skipmark to always skip a test. - Mark expected failures: Use
xfailto mark a test that is expected to fail (e.g., a known bug or a temporary issue).
Marks are applied to the entire test, not to individual stages (except for the skip keyword, which can be applied to stages).
test_name: Get server info from slow endpoint
marks:
- slow
stages:
- name: Get info
request:
url: "{host}/get-info-slow"
method: GET