Manuals / Playwright with Python / Chapter 40
Part 6 · Pro-Level Practices · pro · ~45 min · Chapter 40 of 61
30. Managing Test Suites at Scale
Test tagging and selective execution across large suites Building directly on Chapter 13's markers, at scale you typically layer multiple tagging dimensions rather than one flat list: @pytest.mark.smoke @pytest.mark.module_leave @pytest.mark.critical def test_leave_request_approval_flow(): ... pytest -m "smoke and module_leave" # only smoke tests for the Leave module pytest -m "critical and not sl
Step 1 of 4
Test tagging and selective execution across large suites
Building directly on Chapter 13's markers, at scale you typically layer multiple tagging dimensions rather than one flat list: ... Pointers: Combine markers with boolean expressions (and, or, not) for precise slicing — e.g., running just the critical-path tests for one module before a targeted deploy, without running the entire suite.
Try it
Run / study this snippet
pytest -m "smoke and module_leave" # only smoke tests for the Leave moduleChapter learning outcomes
- Test tagging and selective execution across large suites
- Diagnosing and managing flaky tests systematically
- Writing custom reporters/plugins
- Integrating with test management tools (TestRail, Xray)
Clear these before you leave
Side quest
30. Managing Test Suites at Scale deliverable
Apply one idea from “Test tagging and selective execution across large suites” in a small script or note.