Test Overview
This test checks that pytest reads the pytest.ini configuration file correctly and applies the specified markers and options during test execution.
This test checks that pytest reads the pytest.ini configuration file correctly and applies the specified markers and options during test execution.
import pytest @pytest.mark.slow def test_example(): assert 1 + 1 == 2 # Run with: pytest -m slow
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Pytest starts and reads pytest.ini configuration file | pytest.ini file is present with markers and options defined | pytest recognizes the 'slow' marker from pytest.ini | PASS |
| 2 | Pytest collects tests and finds test_example marked with @pytest.mark.slow | Test suite includes test_example with 'slow' marker | Test is correctly marked as 'slow' | PASS |
| 3 | Pytest runs test_example with marker filter '-m slow' | Only tests marked 'slow' are executed | test_example runs and assertion 1 + 1 == 2 passes | PASS |
| 4 | Pytest finishes test run and generates report | Report shows test_example passed with marker 'slow' | Test report includes marker info and test passed status | PASS |