Additionally, HTML reports can be archived, serving as a historical record of test outcomes, which is invaluable for tracking progress and regression issues over time.
--html=report.html
def pytest_html_report_title(report):
report.title = "Pytest HTML Report Example"
Use pytest-html with GitHub Actions
To generate HTML reports, the only changes you need to make are
-
Add
pytest-html
as a dependency -
Add another step in the workflow for report generation i.e run
pytest --html=report.html
or whatever name you choose -
Include any specification as hooks in
conftest.py