Test Overview
This test checks that a PyTest plugin can extend PyTest by adding a custom marker and that the test using this marker runs and passes correctly.
This test checks that a PyTest plugin can extend PyTest by adding a custom marker and that the test using this marker runs and passes correctly.
import pytest # Plugin code to add a custom marker @pytest.hookimpl(tryfirst=True) def pytest_configure(config): config.addinivalue_line( "markers", "custom_marker: mark test to run with custom behavior" ) @pytest.mark.custom_marker def test_example(): assert 1 + 1 == 2
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | PyTest starts and loads plugins | PyTest environment initialized with custom plugin loaded | - | PASS |
| 2 | PyTest discovers test_example marked with @pytest.mark.custom_marker | Test file scanned, test_example found with custom_marker | - | PASS |
| 3 | PyTest runs test_example | test_example executing | assert 1 + 1 == 2 | PASS |
| 4 | PyTest completes test run and reports results | Test run finished, test_example passed | test_example passed without errors | PASS |