Test Overview
This test checks that pytest correctly reads configuration options from setup.cfg file. It verifies that a simple test runs and respects the configured markers and options.
This test checks that pytest correctly reads configuration options from setup.cfg file. It verifies that a simple test runs and respects the configured markers and options.
import pytest def test_example(): assert 1 + 1 == 2 # setup.cfg content: # [tool:pytest] # markers = example_marker: mark test as example # addopts = -v # Run command: # pytest --markers # pytest test_sample.py
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | pytest starts and reads setup.cfg configuration file | pytest loads [tool:pytest] section with markers and addopts | pytest configuration options are loaded successfully | PASS |
| 2 | pytest discovers test_example function in test file | test_example function is found and ready to run | test function is detected by pytest | PASS |
| 3 | pytest runs test_example with verbosity enabled from addopts | test runs with verbose output | assert 1 + 1 == 2 is true | PASS |
| 4 | pytest finishes test run and reports results | test report shows 1 passed test with verbose details | test report matches expected output with configured verbosity | PASS |