Framework Mode - pytest-mock for enhanced mocking
Folder Structure
test_project/ ├── tests/ │ ├── test_example.py │ ├── test_service.py │ └── __init__.py ├── src/ │ ├── service.py │ └── __init__.py ├── conftest.py ├── requirements.txt └── pytest.ini
This structure separates source code in src/ and tests in tests/. The conftest.py file holds shared fixtures and mocks setup.