Overview - Marker registration
What is it?
Marker registration in pytest is the process of declaring custom labels called markers that you can attach to test functions. These markers help organize, select, or skip tests based on specific criteria. Without registration, pytest warns you about unknown markers and cannot use them effectively.
Why it matters
Without marker registration, you risk pytest showing warnings or ignoring your custom markers, which can lead to confusion and unreliable test runs. Proper registration ensures your tests are clearly categorized and controlled, making large test suites easier to manage and faster to run selectively.
Where it fits
Before learning marker registration, you should understand basic pytest test functions and how to run tests. After mastering marker registration, you can explore advanced test selection, conditional skipping, and pytest configuration files.