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

How to use parameterized fixtures in pytest-bdd

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
testing

調査の方向性

まず、示されているパラメーター化された ba_data fixture と @given ステップを、最小限の pytest-bdd シナリオで再現します。pytest-bdd がシナリオステップの fixture をどのように解決するかを確認し、その後、報告されているパラメーター不足エラーなしで、動的に生成されたデータを使ってシナリオを複数回実行できることを検証します。

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

説明

question

I am trying to use parameterized fixture in my pytest-bdd framework. Normal fixture works fine. But If I am passing parameters, it gives below error

""The requested fixture has no parameter defined for test:""

Below is my code(Sample). Waht is the correct usage here?

@pytest.fixture(params=[1,2])
def ba_data(request):
print("this is fixture")
return request.param

@given(parsers.cfparse('Collect testdata'))
def required_data(ba_data):
print(ba_data)

actual need behind this:
I wanted to run entrire scenario multiple times, with dynamically generated data

主要言語
Python
スター
1.5k
フォーク
251
平均マージ
43分
マージ済み PR(30日)
2

環境構築

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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