In the previous chapters, we saw how to divide our test suite into subsets that we can run on demand based on their purpose and cost. The way to do so involved dividing the tests by directory or by name, such that we could point the test runner to a specific directory or filter for test names with the -k option.
While those strategies are available on pytest too, pytest provides more ways to organize and divide tests; one of them being markers.
Instead of naming all our smoke tests "test_smoke_something", for example, we could just name the test "test_something" and mark it as a smoke test. Or, we could mark slow tests, so that we can avoid running slow ones during the most frequent runs.
Marking a test is as easy as decorating it with @pytest.mark.marker, where marker is our custom label. For example, we could create two tests and use @pytest.mark.first to mark the first of the two tests:
import pytest
@pytest.mark.first
def test_one...