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

Extras added after test execution in fixture are ignored

Aperta
#820 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #1073 di @afonsojanu — chiusa senza merge

Valutazione

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

Direzione di ricerca

Inizia riproducendo l’esempio documentato della fixture degli extras e traccia il modo in cui gli extras vengono raccolti nel report HTML prima e dopo l’esecuzione dei test. Verifica se è possibile includere gli extras successivi a yield; il lavoro è completato quando questi link compaiono nel report oppure la limitazione è documentata chiaramente.

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

Descrizione

The docs explain that one can use the extras fixture to add content to the html report, however only some of the extras are added. In the following code:

import pytest_html

def test_extra(extras):
    extras.append(pytest_html.extras.text("before test!"))
    yield # run test
    extras.append(pytest_html.extras.text("after test!"))

only the before test part is actually added to the report. The docs don't mention anything about this behavior, so hard to tell if its a bug or not.

If this is a limitation of the framework, it would be really helpful to document it. If not, it would be really handy to fix it.

In my use case, I have a test which generates some files which I'd like to link to from the report. That has to be done after the test completes, but my links never show up in the report.

Thanks!

Lingua principale
Python
Stelle
779
Fork
259
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.