Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pytest-html version 3.1.1 bug- Internal error in pytest_runtest_makereport causes test to show as Passed in HTML report

Aperta
#1,027 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
html, python
Ambito
testing-qa

Direzione di ricerca

Inizia riproducendo il problema con pytest-html 3.1.1, pytest, --html=report.html e un'eccezione o un'interruzione da tastiera nell'hook pytest_runtest_makereport. Traccia il percorso del risultato dell'hook fino al report HTML e assicurati che il test interessato non venga visualizzato come Passed; resta da risolvere se l'esito previsto debba essere ERROR o FAILED.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

  1. Trigger an exception inside pytest_runtest_makereport hook for eg raise RuntimeError("BOOM")
  2. Run pytest with --html=report.html
  3. Open the HTML report
  4. 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

Lingua principale
Python
Stelle
779
Fork
261
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pytest-dev/pytest-html

Tutte le issue di pytest-dev/pytest-html

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.