Framework Mode - Handling shared resources
Folder Structure
tests/ ├── test_login.py ├── test_shopping_cart.py ├── test_checkout.py conftest.py utils/ ├── db_helper.py ├── api_client.py pytest.ini requirements.txt
tests/ ├── test_login.py ├── test_shopping_cart.py ├── test_checkout.py conftest.py utils/ ├── db_helper.py ├── api_client.py pytest.ini requirements.txt
conftest.py to setup and teardown shared resources like database connections, test data, or web drivers.tests/ folder use fixtures to access shared resources safely.utils/ provide reusable functions for resource management, e.g., database queries or API calls.pytest.ini and environment variables control test settings and resource parameters.pytest.ini to define default test options and markers..env files to store sensitive data like credentials or URLs.conftest.py that read configuration and initialize shared resources once per session or module.scope="session" to share the connection across all tests safely.--junitxml=report.xml for CI systems.pytest-html for readable HTML reports.Where in this framework structure would you add a new fixture to manage a shared API client used by multiple tests?