Test Overview
This test checks that a custom marker slow is registered in pytest.ini and can be used to mark tests. It verifies that pytest recognizes the marker and runs the test accordingly.
This test checks that a custom marker slow is registered in pytest.ini and can be used to mark tests. It verifies that pytest recognizes the marker and runs the test accordingly.
import pytest @pytest.mark.slow def test_example(): assert 1 + 1 == 2 # pytest.ini content: # [pytest] # markers = # slow: marks tests as slow to run
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test runner starts pytest and reads pytest.ini configuration | pytest.ini file is loaded with 'slow' marker registered | - | PASS |
| 2 | pytest discovers test_example function marked with @pytest.mark.slow | Test function is found with 'slow' marker attached | - | PASS |
| 3 | pytest runs test_example | Test executes the assertion 1 + 1 == 2 | Assert that 1 + 1 equals 2 | PASS |
| 4 | pytest reports test result | Test passed without errors, marker recognized | Test marked as 'slow' is accepted and runs successfully | PASS |