Framework Mode - Dynamic fixture selection
Folder Structure
tests/ ├── test_login.py ├── test_checkout.py ├── conftest.py utilities/ ├── browser_manager.py ├── data_loader.py config/ ├── config.yaml reports/ ├── latest_report.html pytest.ini
tests/ ├── test_login.py ├── test_checkout.py ├── conftest.py utilities/ ├── browser_manager.py ├── data_loader.py config/ ├── config.yaml reports/ ├── latest_report.html pytest.ini
conftest.py, provides dynamic fixtures that select resources based on test parameters or environment variables.tests/ use fixtures to get test data or browser instances dynamically.browser_manager.py manage browser setup and teardown, supporting dynamic fixture behavior.config/config.yaml holds environment-specific settings used by fixtures to decide which resources to provide.pytest.ini or environment variables to specify parameters like --env or --browser.conftest.py reads these parameters and selects fixtures dynamically using request.config.getoption().@pytest.fixture(params=[...]) or conditional logic inside fixtures to provide different resources.pytest-html or pytest-allure plugins to generate readable HTML or Allure reports.reports/ folder with timestamps for history.request.param and request.config.getoption() for flexibility: This allows tests to control fixture behavior without code changes.Where in this framework structure would you add a new fixture that selects a database connection dynamically based on the test environment?