Manuals / Playwright with Python / Chapter 35
Part 5 · CI/CD & Reporting · advanced · ~40 min · Chapter 35 of 61
26. Test Reporting
HTML report (pytest-html) pip install pytest-html pytest --html=report.html --self-contained-html pytest --html=<path> --self-contained-html What it does: Generates a single-file HTML report summarizing pass/fail/skip results after a test run. Types/params: ● --html=<path> (string, required) — output file location ● --self-contained-html (flag, optional) — embeds CSS/JS directly in the file so it'
Step 1 of 3
HTML report (pytest-html)
What it does: Generates a single-file HTML report summarizing pass/fail/skip results after a test run. Types/params: Pointers: Good baseline reporting with minimal setup. Lacks the richer history-tracking and screenshot/trace attachment support that Allure offers — reach for Allure once a team needs more than a quick pass/fail summary.
- --html=<path> (string, required) — output file location
- --self-contained-html (flag, optional) — embeds CSS/JS directly in the file so it's viewable standalone without needing internet access or separate asset files
Try it
Run / study this snippet
pip install pytest-htmlChapter learning outcomes
- HTML report (pytest-html)
- Allure reporting setup
- Publishing reports as CI artifacts
Clear these before you leave
Side quest
26. Test Reporting deliverable
Apply one idea from “HTML report (pytest-html)” in a small script or note.