Framework Mode - JUnit XML reporting for CI
Folder Structure
project-root/ ├── tests/ │ ├── test_example.py │ └── test_login.py ├── reports/ │ └── junit-report.xml ├── conftest.py ├── pytest.ini └── requirements.txt
project-root/ ├── tests/ │ ├── test_example.py │ └── test_login.py ├── reports/ │ └── junit-report.xml ├── conftest.py ├── pytest.ini └── requirements.txt
tests/ folder, contains test scripts like test_example.py.conftest.py holds reusable setup/teardown code and fixtures.reports/ folder stores generated JUnit XML reports for CI consumption.pytest.ini configures pytest options including JUnit XML output.requirements.txt lists Python packages like pytest.Use pytest.ini to configure JUnit XML reporting and other options:
[pytest] addopts = --junitxml=reports/junit-report.xml
This tells pytest to generate a JUnit XML report in the reports/ folder after tests run.
For environment-specific settings (like test URLs or credentials), use environment variables or separate config files loaded in conftest.py.
reports/junit-report.xml) is a standard format understood by most CI tools (Jenkins, GitHub Actions, GitLab CI).pytest with the configured --junitxml option to generate the report.reports/ folder to separate outputs from source code.pytest.ini or command-line options to control report generation consistently.Where in this folder structure would you add a new test file for user registration?