python / python/cpython

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

未關閉
#149,755 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

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. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 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 摘要。