marker
A label attached to a test with @pytest.mark.name so you can select, skip or configure tests by that label.
In more detail
Register custom markers in the configuration file with a one-line description; with --strict-markers a misspelt marker then becomes an error instead of a label nobody selects. pytest -m "not slow" runs everything except the slow tests, which is the fast set to run on every save.
Example
pytest -q -m "not slow"Related terms
- pytest.ini — A configuration file in a project's root directory that holds pytest settings, such as registered markers.
- deselected — The count pytest reports for tests that were collected but left out of this run by a -k or -m selection.
- decorator — A line starting with @ placed above a function or class that wraps it to add behaviour or information.
- test pyramid — A guide for balancing a test suite: many fast unit tests, fewer integration tests and a small number of end-to-end tests.
Taught in
- The Test Pyramid And Where It Is Wrong — Automated Testing, TDD & Quality Engineering
- Parametrised Tests — Automated Testing, TDD & Quality Engineering