Overview of pytest-order features
mainThe pytest-order plugin provides several ways to control test execution flow:
- Index-based ordering: Use ordinal numbers (including negative indices) to position tests.
- Relative ordering: Use
beforeandaftermarker attributes to define relationships between specific tests. - Scope-based ordering: Control ordering at the session, module, class, or directory levels using configuration options like
order-scopeandorder-scope-level. - Hierarchical ordering: Use
order-group-scopefor module and class-level grouping. - Dependency integration: Order tests alongside
pytest-dependencymarkers using theorder-dependenciesoption. - Sparse ordering: Use the
sparse-orderingoption to manage non-contiguous test sequences. - Custom marker prefixes: Use the
order-marker-prefixoption to change the default marker name.