Parameterized tests cannot be ordered
まだ誰も着手していません。
評価
調査の方向性
リンクされている pytest のパラメータ化の例から始め、示されている --order-scope=class と --order-group-scope=class オプションを使って再現してください。パラメータ化されたシナリオがどのように収集され、順序付けられるかを追跡してください。クラススコープでの実行結果が demo2[basic]、demo1[basic]、demo2[advanced]、demo1[advanced] となり、その順序に対するリグレッションカバレッジがあれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-order のほかの issue
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pytest-dev/pytest-order#64 · コメント 5 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
pytest-dev/pytest-order#51 · コメント 6 件 · リアクション 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
pytest-dev/pytest-order#50 · コメント 4 件 ·
pytest-dev/pytest-order の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4524 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
topoteretes/cognee#5982 ·
メンテナーはふだん 1 日以内に返信
-
Patches of derivations with `__structuredAttrs` are ignored対応中かも @KiaraGrouwstra が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
nix-community/vulnix#184 ·
-
New Internshipオープンnew_internship
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
aws-samples/sample-per-model-bedrock#295 ·
メンテナーはふだん 1 日以内に返信