Find a way to filter concept exercises by taskno from the command line (concept exercises)

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
cli, testing

調査の方向性

まず 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:

  1. @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.

  1. 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:

  1. pytest -k keyword_you_need
    It usually works, but sometimes I still select more of fewer tests than needed
  2. pytest --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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

exercism/python-test-runner のほかの issue

exercism/python-test-runner の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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