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

pytest_bdd_apply_tag does not detect Gherkin example tags

Aperta
#774 3 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
62/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

Inizia individuando l’hook pytest_bdd_apply_tag e la gestione esistente dei tag negli esempi Gherkin, quindi esamina i test correlati per @skip e @xfail. Aggiungi la copertura per i tag personalizzati inseriti nelle tabelle degli esempi e verifica che l’hook li riceva, mentre il comportamento esistente delle tabelle degli esempi rimane invariato.

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

Descrizione

Is your feature request related to a problem? Please describe.
Tags on example tables are not picked up by the pytest_bdd_apply_tag.

i.e.

Feature: My Feature
    Scenario: My scenario case <case>
    
    Examples:
        | case |
        | 1    |
        | 2    |

    @xfail @supresswarning=DeprecationWarning
    Examples:
        | case |
        | 3    |

case 3 does get marked with xfail, but pytest_bdd_apply_tag never sees either tag.

Describe the solution you'd like
All tag locations supported by Gherkin features are intercepted by the tag hook.

Describe alternatives you've considered
Use custom tags on the entire scenario
Use @xfail and @skip tags without specifying a reason
Use request.node.add_marker() in relevent python steps that can branch on example parameters

Additional context
@skip and @xfail are working for example tables, but they and new tags can't be customised.

Lingua principale
Python
Stelle
1.5k
Fork
251
Merge medio
3h 41m
PR unite (30g)
4

Preparare l'ambiente

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-bdd

Tutte le issue di pytest-dev/pytest-bdd

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.