python / python/cpython

Add tests for command-line interface

オープン
#131,178 コメント 13 件 リアクション 2 件 担当者 1 名 GitHub で見る

@donbarbos がすでに取り組んでいます。

2025年3月13日 から。

easy tests type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

While working on #130160 and #93096 it was decided that it would be worth paying attention to the problem of lack of tests for command line interface.

List of all cli modules is in the documentation: https://docs.python.org/dev/library/cmdline.html

Many modules are missing command line interface tests, so I suggest using this issue to submit PRs for now only for well-documented interfaces, for example:

  • tokenize (gh-131274)
  • platform (gh-131542)
  • pickle (gh-131275)
  • ast (gh-133329)
  • pickletools (gh-131287)
  • http.server (gh-132540)
  • profile (gh-134103)
  • cProfile (gh-134269)
  • site (gh-133582)

TODO: Make sure all documented have tests for CLI (others are not so important as it has not been decided what to do with them yet)

You can use PR #127759 for dis module or #118132 for random module as a reference.
And I also suggest using subprocess.Popen to allocate a separate resource since some modules can block a lot of time.

[!IMPORTANT]
For those who want to work on the issue, please:

  • Select one module for which tests will be improved. It's easier to review and backport.
  • Open a pull request with the following title: gh-131178: Add tests for `MODULE_NAME` command-line interface
Linked PRs
  • gh-131274
  • gh-131275
  • gh-131287
  • gh-131326
  • gh-132540
  • gh-133329
  • gh-133582
  • gh-134103
  • gh-134224
  • gh-134269
  • gh-134279
  • gh-134287
  • gh-137748
  • gh-137807
  • gh-137816
  • gh-137832
  • gh-137833
  • gh-139934
  • gh-139947
  • gh-139983
  • gh-140199
  • gh-140200
  • gh-143835
  • gh-144918
  • gh-147995
  • gh-149681
  • gh-149683
  • gh-149825
  • gh-149868
  • gh-150203
  • gh-150655
  • gh-150656
  • gh-151855
  • gh-151971
  • gh-157133
  • gh-157154

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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