Skip to content

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

Open

Description

@skirpichev

This is a follow-up of #115119.

The bench.py script already partially integrated to the pyperformance, see python/pyperformance#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

Activity

  1. self-assigned this
    on May 13, 2026
  2. added
    type-feature
    tests
    extension-modules
    3.16
    on May 13, 2026
  3. changed the title [-]Remove (or integrate to CI/pyperformance) tests in Module/_decimal/tests[/-] [+]Remove (or integrate to CI/pyperformance) Module/_decimal/tests[/+] on May 13, 2026
  4. skirpichev commented on Aug 6, 2026

    @skirpichev
    MemberAuthor

    I think we should just remove the benchmark and fix tests (i.e. hash issue).

    It's not practical to run this in CI, it overlaps with the regular test_decimal, but perhaps it's good to have this alive as more extensive test suite, checking both (C and pure-Python) implementations. I don't think this will be broken often, based on prior experience: for 10+ years there is only two issues (see description).

    CC @serhiy-storchaka

  5. removed their assignment
    on Aug 6, 2026
  6. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16extension-modulesteststype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions