pytest-html version 3.1.1 bug- Internal error in pytest_runtest_makereport causes test to show as Passed in HTML report
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- html, python
- Domínio
- testing-qa
Direção de pesquisa
Comece reproduzindo o problema com pytest-html 3.1.1, pytest, --html=report.html e uma exceção ou interrupção de teclado no hook pytest_runtest_makereport. Rastreie como o resultado do hook chega ao relatório HTML e garanta que o teste afetado não seja exibido como Passed; ainda é necessário resolver se o resultado pretendido deve ser ERROR ou FAILED.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 779
- Forks
- 259
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de pytest-dev/pytest-html
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
pytest-dev/pytest-html#1077 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 42/100
pytest-dev/pytest-html#1039 ·
-
Feature: pluggable HTML themes via Jinja2 template inheritanceTalvez já em andamento @RonnyPfannschmidt assumiu há 137 dias. Aberta
pytest-dev/pytest-html#1029 · 1 reação · 1 responsável ·
-
pytest-html does not escape HTML in testId (v4.2.0)Talvez já em andamento @golikovichev assumiu há 121 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
pytest-dev/pytest-html#1024 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
pytest-dev/pytest-html#1010 ·
Todas as issues de pytest-dev/pytest-html
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
MystenLabs/MemWal#1163 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
infertopics leaves new nodes without a topic when untopiced neighbours outnumber topiced onesTalvez já em andamento @moneebullah25 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
FinanceFlash/unvibecode#218 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
NVIDIA/earth2studio#1241 ·
Mantenedores costumam responder em até 3 dias