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

Rewrite pytest-bdd to use hooks and marks

オープン
#310 コメント 8 件 リアクション 3 件 担当者 0 名 GitHub で見る

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
testing

調査の方向性

まず issue #296 と、そこからリンクされている marks と hooks に関する pytest のドキュメントを読み、次に issue に示されている現在の pytest-bdd デコレーターと提案された API を比較します。リライトによって既存の機能を維持できるかを判断し、@scenario mark の役割を決定します。合意された設計と実装計画ができれば完了です。

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

説明

Following the suggestion from issue #296, I will try to re-implement pytest-bdd to use marks and hooks.

I imagine an API that will look like this:

# test_some_scenario.py
pytestmark = pytest.mark.scenarios('a.feature')

# override "Scenario 3"
@pytest.mark.scenario('a.feature', 'Scenario 3')
def test_a_scenario(...):
    # do something more
    pass

instead of the current way:

import pytest_bdd

# override "Scenario 3"
@pytest_bdd.scenario('a.feature', 'Scenario 3')
def test_a_scenario(...):
    # do something more
    pass

scenarios('a.feature')

I yet don't know if this is entirely feasible without breaking other features, but we will see.

Short note about @scenario(...)

Potentially, I will also remove the single scenario mark/decorator, given that the only thing it allows to do is to require some more fixtures before the scenario is run, and to execute some more logic after the scenario finished.
This custom logic can already be implemented using given and then steps, but I understand that sometimes it can be just some compensation logic that should not appear in the feature file.
I still didn't figure out what to do with this, so probably I'll keep the @scenario mark/decorator for the time being.

@bubenkoff @olegpidsadnyi @sliwinski-milosz: Feedback on this idea would be appreciated.

主要言語
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 を短くまとめたダイジェスト。