python / python/cpython

Remove (or integrate to CI/pyperformance) Module/_decimal/tests

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

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

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

説明

This is a follow-up of #115119.

The bench.py script already partially integrated to the pyperformance, see https://github.com/python/pyperformance/issues/473.

The Modules/_decimal/tests/deccheck.py currently is broken. Even with the patch

diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py
index bf277dd6879..b276700bc01 100644
--- a/Modules/_decimal/tests/deccheck.py
+++ b/Modules/_decimal/tests/deccheck.py
@@ -53,6 +53,8 @@
 from formathelper import rand_format, rand_locale
 from _pydecimal import _dec_from_triple
 
+sys.set_int_max_str_digits(0)
+
 C = import_fresh_module('decimal', fresh=['_decimal'])
 P = import_fresh_module('decimal', blocked=['_decimal'])
 EXIT_STATUS = 0

I still got

$ ./python Modules/_decimal/tests/deccheck.py --short


Random seed: 1778644369


testing __abs__ ...
    prec: 3  emin: -3  emax: 3
[...]
testing __hash__ ...
    prec: 3  emin: -3  emax: 3
Traceback (most recent call last):
  [...]
  File "/home/sk/src/cpython/Modules/_decimal/tests/deccheck.py", line 570, in skip_error
    return getattr(shandler, t.funcname, shandler.default)(t)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not callable

Probably these tests now are partially overlap with the CI tests. I think we should investigate this and merge tests or just run deccheck.py as part of CPython test suite.

Linked PRs
  • gh-155198
  • gh-155261

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

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

はじめの一歩

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

調査の方向性

Modules/_decimal/tests/deccheck.py から始め、表示されている ./python Modules/_decimal/tests/deccheck.py --short の失敗を再現します。これらのテストを、重複している CI テストおよび issue #473 で参照されている部分的な pyperformance 統合と比較します。重複が解消され、deccheck.py がテストワークフローに統合されるか削除されれば完了です。

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

評価

技術スタック
python
領域
ci-cd, testing-qa
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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