Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#430 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
testing

調査の方向性

未定義のステップと --cucumber-json フラグを指定して feature を実行し、問題を再現してから、生成された cucumber-JSON と scenario.steps の処理を調査します。KeyError または FixtureLookupError によって、レポート内でテストケースが成功ではなく失敗として表示されれば、修正は完了です。

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
1.5k
フォーク
253
平均マージ
4時間 30分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pytest-dev/pytest-bdd のほかの issue

pytest-dev/pytest-bdd の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。