pytest-html version 3.1.1 bug- Internal error in pytest_runtest_makereport causes test to show as Passed in HTML report
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- html, python
- Domain
- testing-qa
Research direction
Start by reproducing the issue with pytest-html 3.1.1, pytest, --html=report.html, and an exception or keyboard interrupt in the pytest_runtest_makereport hook. Trace how the hook result reaches the HTML report and ensure the affected test is not displayed as Passed; the intended ERROR versus FAILED outcome still needs resolution.
Written by the indexing model from the issue text.
Description
Description
When an internal error occurs inside the pytest_runtest_makereport hook,
pytest-html 3.1.1 does not receive a valid report outcome and silently
defaults to displaying the test as Passed in the HTML report.
Environment
- pytest-html: 3.1.1
- pytest: 7.1.2 or 9.0.3
- Python: 3.13.7
- OS: Windows
Expected Behavior
Test should be marked as ERROR in the HTML report.
Actual Behavior
Test is marked as Passed in the HTML report, giving a false green result.
Steps to Reproduce
- Trigger an exception inside
pytest_runtest_makereporthook for eg raise RuntimeError("BOOM") - Run pytest with
--html=report.html - Open the HTML report
- Observe the affected test shows as Passed
Additional Notes
pytest-html 4.2.0 handles this differently — the report is empty instead
of showing a false Passed — but neither behavior is correct.
the correct expected outcome is debatable:
ERROR — represents a framework/fixture level problem, not a test assertion failure. This is probably the most accurate.
FAILED — could argue this since something clearly went wrong.
At minimum — not Passed, since that's factually wrong.
-In case of keyboard interrupt too same issue
- Dominant language
- Python
- Stars
- 779
- Forks
- 261
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytest-dev/pytest-html
-
test_rerun integration tests fail with pytest-rerunfailures 16.7Possibly taken @nicozdeb claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pytest-dev/pytest-html#1085 · 1 comment ·
-
HTML extras for 'call' and 'teardown' phases get mergedPossibly taken @contputer0x0 claimed this 24 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
pytest-dev/pytest-html#1077 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
pytest-dev/pytest-html#1039 ·
-
Feature: pluggable HTML themes via Jinja2 template inheritancePossibly taken @RonnyPfannschmidt claimed this 164 days ago. Open
pytest-dev/pytest-html#1029 · 1 reaction · 1 assignee ·
-
pytest-html does not escape HTML in testId (v4.2.0)Possibly taken @golikovichev claimed this 148 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
pytest-dev/pytest-html#1024 ·
All issues in pytest-dev/pytest-html
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
huggingface/deep-rl-class#723 ·
-
[tool] bug: Qwen3 XML tool parser raises on `...` argument values (Ellipsis is not JSON serializable)Possibly taken @super-yuki claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
verl-project/verl#8559 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TencentCloud/octop-harness#228 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
google/osv-scalibr#2585 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
NousResearch/hermes-agent#149323 ·
Maintainers usually reply within 1 day