Find a way to filter concept exercises by taskno from the command line (concept exercises)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
調査の方向性
まず pytest のマークの使用方法と、issue で言及されている conftest の関数を読んでから、概念演習でタスク選択の問題を再現します。pytest がコマンドラインからマーカー引数をどのように公開するかを調査します。pytest -k に依存せず、無関係なテストを選択することなく、ユーザーが数値の taskno でテストを選択できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi,
Pytest test suites in Exercism contain custom marks in the form of @pytest.mark.task(taskno=X) where X is a whole number. At least in concept exercises, this number corresponds to the task inside the supplied README file.
While doing a concept exercise, I wanted to select pytest tests to run and filter them by this taskno parameter but failed to do so. What I tried:
- @BethanyG sent me a link to StackOverflow thread which shows one similar problem:
However, the example code allows to run marks with arguments looking like this:
@pytest.mark.task("taskno1")
Perhaps there is a way to modify something in the conftest functions but I haven't wrapped my head around it.
- I tried a plugin called pytest-pilot
It supplies easier syntax for solving similar problems as 1 but also didn't help me solve the problem. I would get an error IndexError: tuple index out of range.
What I use now:
pytest -k keyword_you_need
It usually works, but sometimes I still select more of fewer tests than neededpytest --tb=short
I don't like long error messages from pytests so this is another way to limit pytest from adding too much unwanted output.
Filtering by task number would be "nice to have", but I think solving this problem is interesting in itself. All help is welcome :)
- 主要言語
- Python
- スター
- 13
- フォーク
- 20
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
exercism/python-test-runner のほかの issue
-
exercism/python-test-runner#101 · コメント 7 件 · 担当者 1 名 ·
-
bug
exercism/python-test-runner#67 · 担当者 1 名 ·
exercism/python-test-runner の issue をすべて見る
似ている issue
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
simonw/sqlite-utils#872 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100