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

Cucumber-Json flags failed tests as passed if an exception occurs

Aperta
#430 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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
python
Ambito
testing

Direzione di ricerca

Riproduci il problema eseguendo la feature con uno step non definito e il flag --cucumber-json, quindi ispeziona il cucumber-JSON generato e la gestione di scenario.steps. La correzione è completa quando un KeyError o FixtureLookupError fa sì che il caso di test risulti fallito anziché superato nel report.

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

Descrizione

Version: bdd-4,0,2 pytest: 6.2.2

Summary
When a test fails with eg an keyerror exception due to an invalid test step, the cucumber-json will mark the test case as passed. When imported back into eg XRAY the test is marked as passed when in fact it has not.

This happens because the invalid step is not included in the test report scenario.steps and will therefore not appear in the cucumber-json causing test cases results to be inaccurate.

Steps to Repro:

  1. Execute a feature file containing a step not defined in the framework. This will trigger an KeyError exception and a FixtureLookupError. Ensure the --cucumber-json flag was passed into pytest-bdd :
Scenario:  repro
    Given this step should exist and be valid
    And this step should not exist

  1. Examine the resultant cucumber-json file. Notice the test case is marked as passed as the erroring test step was not included.
Lingua principale
Python
Stelle
1.5k
Fork
252
Merge medio
2h 8m
PR unite (30g)
5

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.