pytest-html version 3.1.1 bug- Internal error in pytest_runtest_makereport causes test to show as Passed in HTML report
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
- 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
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-html
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
pytest-dev/pytest-html#1077 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
pytest-dev/pytest-html#1039 ·
-
Feature: pluggable HTML themes via Jinja2 template inheritanceForse già presa @RonnyPfannschmidt l’ha presa 136 giorni fa. Aperta
pytest-dev/pytest-html#1029 · 1 reazione · 1 assegnatario ·
-
pytest-html does not escape HTML in testId (v4.2.0)Forse già presa @golikovichev l’ha presa 120 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
pytest-dev/pytest-html#1024 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
pytest-dev/pytest-html#1010 ·
Tutte le issue di pytest-dev/pytest-html
Issue simili
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ramnes/notion-sdk-py#409 ·
-
good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lindicaphxag-tech/kaggle#28 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
BSData/horus-heresy-3rd-edition#3211 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno