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

Parameterized tests cannot be ordered

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
testing

調査の方向性

リンクされている pytest のパラメータ化の例から始め、示されている --order-scope=class と --order-group-scope=class オプションを使って再現してください。パラメータ化されたシナリオがどのように収集され、順序付けられるかを追跡してください。クラススコープでの実行結果が demo2[basic]、demo1[basic]、demo2[advanced]、demo1[advanced] となり、その順序に対するリグレッションカバレッジがあれば完了です。

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

説明

enhancement

Considering the example in pytest documentation:
https://pytest.org/en/6.2.x/example/parametrize.html#a-quick-port-of-testscenarios

If I include ordering:

scenario1 = ("basic", {"attribute": "value"})
scenario2 = ("advanced", {"attribute": "value2"})


class TestSampleWithScenarios:
    scenarios = [scenario1, scenario2]

    @pytest.mark.order(2)
    def test_demo1(self, attribute):
        assert isinstance(attribute, str)

    @pytest.mark.order(1)
    def test_demo2(self, attribute):
        assert isinstance(attribute, str)

I would expect this order:

test_scenarios.py::TestSampleWithScenarios::test_demo2[basic] PASSED     [ 25%]
test_scenarios.py::TestSampleWithScenarios::test_demo1[basic] PASSED     [ 50%]
test_scenarios.py::TestSampleWithScenarios::test_demo2[advanced] PASSED  [ 75%]
test_scenarios.py::TestSampleWithScenarios::test_demo1[advanced] PASSED  [100%]

But I get instead:

test_scenarios.py::TestSampleWithScenarios::test_demo2[basic] PASSED     [ 25%]
test_scenarios.py::TestSampleWithScenarios::test_demo2[advanced] PASSED  [ 50%]
test_scenarios.py::TestSampleWithScenarios::test_demo1[basic] PASSED     [ 75%]
test_scenarios.py::TestSampleWithScenarios::test_demo1[advanced] PASSED  [100%]

I have tried with --order-scope=class and --order-group-scope=class but they dont fix this.

主要言語
Python
スター
211
フォーク
17
平均マージ
2日 3時間
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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