python / python/mypy

Trim "mypy/tests/testX.py::XDataSuite::" from test items

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

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

feature topic-developer topic-tests
主要言語
Python
スター
20.6k
フォーク
3.3k
PR マージ指標
PR 指標を取得中

説明

We can rewrite test collection so that e.g. test-data/unit/check-abstract.test is deemed the test node, rather than mypy/test/testcheck.py::CheckTestSuite::check-abstract.test. This would improve the ergonomics of test invocation, so that one could simply invoke e.g.

pytest test-data/unit/check-abstract.test

Technically, we'd follow the recipe in Working with non-python tests. Each data suite would implement a pytest_collect_file. However, it would also mean we'd need a "registry" of all data suites, since the collection mechanism would need to "ask" all data suites whether they handle the file (in some cases, multiple data suites could each emit items for the same file & test -- see test_name_suffix).

The non-data-suite tests (e.g. those deriving from TestCase) would remain unaffected.

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

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

はじめの一歩

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

調査の方向性

mypy/test/testcheck.py::CheckTestSuite::check-abstract.test の collection パスと、データファイル test-data/unit/check-abstract.test から始めてください。pytest の Working with non-python tests レシピを読んでから、data suites と test_name_suffix が現在どのように項目を識別しているかを追跡してください。pytest がデータファイルを直接呼び出せる一方で、data suites ではない TestCase テストには影響が残らなければ完了です。

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

評価

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

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

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