project-root/
├── tests/
│ ├── test_example.py
│ ├── test_output_capture.py
│ └── conftest.py
├── src/
│ └── app.py
├── pytest.ini
└── requirements.txt
This structure keeps tests separate from source code. tests/ holds all test files including those using capsys.