Framework Mode - capsys for stdout/stderr
Folder Structure
project-root/
├── tests/
│ ├── test_example.py
│ ├── test_utils.py
│ └── conftest.py
├── src/
│ └── app_code.py
├── pytest.ini
└── requirements.txt
This structure keeps test files inside tests/ and application code inside src/. The conftest.py file holds shared fixtures and setup.