python / python/cpython

IDLE: Move unittests to test directory

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

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

2022年7月20日 から。

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

説明

In particular, move unittest-related files in idlelib.idle_test to a new test/test_idle directory and split test/test_idle.py into test_idle/__init__.py and test_idle/__main__.py. This is a followup to #54781 and similar issues before and after. Note that I want idle_test and any non-unittest files (at least htest.py and part of README.txt) left as they are.

Other core developers want this for consistency, as best explained by Victor Stinner in https://github.com/python/cpython/issues/93839#issue-1271983348. None of those benefits apply to me, and there are costs to the change that could or would make IDLE development harder, perhaps significantly so.

The costs come from some of idlelib's special features as a package: a) it comprises about 60 modules, far more than any other stdlib package; b) the test suite is underdeveloped relative to at least some other packages, so there are (or should be) relatively more future test changes to be impacted; c) PEP 434 allows name changes and backports not allowed elsewhere in the stdlib, so there are many more of these.

  1. Search and replacement: a multifile recursive search currently displays all hits in idlelib and idlelib.idle_test with one command and puts all hits in one window. When editing any idlelib file, Alt-F3 opens IDLE's grep with idlelib as the default search directory. Having to give the command twice and having the results in two windows would be a pain. (IDLE's grep could special case recursive searches in idlelib to include test.test_idle.)

  2. Existing PRs: I would guess that there are at least 20 current PRs that modify IDLE tests. Will they all break or will old paths be automatically mapped to new paths. If they will break, I would want an automated fix (for just main) or else dispose of most of them before moving the tests.

  3. Backports: currently, code backports, which are nearly always done, are accompanied by any corresponding test changes. Victor claims in #94145 that git will always (my emphasis) map new paths in a PR to the old paths. (This would require that it keep a reverse dictionary of path changes.) I would like to see this work before I believe this.

Linked PRs
  • gh-115444

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

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

はじめの一歩

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

評価

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

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

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