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

How to customize auto-generated test name when using Scenario Outline?

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

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

評価

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

調査の方向性

@scenario の使用箇所と executed.feature から始め、Scenario Outline Examples の行がどのように pytest のテスト名になるかを追跡します。プロジェクトが、サポート対象の命名フックまたは設定ポイントを公開しているかを確認します。compare、seconds、name の提示された値をカバーし、生成される名前をカスタマイズする方法が文書化されていれば完了です。

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

説明

First things first, thanks to everybody involved for creating such a useful module, I'm loving it. It took some time getting used to but now I feel like I'm flying.

Now the question: How to customize auto-generated test name when using Scenario Outline?
I have a test scenario where I'm using data

compare = [<, =, >]
name = [RISING, FALLING, NONE]
seconds= [0.0, 1.0]

that forms a Examples: table:

Examples:
| compare | seconds | name   |
| <       | 0       | NONE   |
| <       | 1       | NONE   |
| =       | 0       | NONE   |
| =       | 1       | NONE   |
| >       | 0       | NONE   |
| >       | 1       | NONE   |
| =       | 0       | RISING |
...

for this

@scenario('executed.feature', 'Scenario becoming true',
          example_converters=dict(compare=str, seconds=float, name=str))
def test_scenario_never_becomes_true():
    pass

and the output looks like
image

I've tried searching for pytest hook where I could get the test and generate a new name for it but didn't manage to find anything.

主要言語
Python
スター
1.5k
フォーク
251
平均マージ
3時間 41分
マージ済み PR(30日)
4

環境構築

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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