Skip to content

gh-85989: move HAVE_DOUBLE_ROUNDING check to test.support - #150219

Merged
vstinner merged 9 commits into
python:mainfrom
skirpichev:test-support-double-rounding
May 28, 2026
Merged

gh-85989: move HAVE_DOUBLE_ROUNDING check to test.support#150219
vstinner merged 9 commits into
python:mainfrom
skirpichev:test-support-double-rounding

Conversation

@skirpichev

@skirpichevskirpichev commented May 22, 2026

Copy link
Copy Markdown
Member

This adds skip_if_double_rounding decorator.

@skirpichevskirpichev changed the title gh-85989: add HAVE_DOUBLE_ROUNDING check to test.supportgh-85989: move HAVE_DOUBLE_ROUNDING check to test.supportMay 26, 2026
@skirpichev

Copy link
Copy Markdown
MemberAuthor

CC @vstinner

Comment threadLib/test/support/__init__.py Outdated
@skirpichev
skirpichev requested a review from vstinnerMay 26, 2026 02:36

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment threadLib/test/support/__init__.py Outdated
@vstinner

Copy link
Copy Markdown
Member

I merged #150432. It created conflicts. Can you please update your PR to solve conflicts?

@skirpichev

Copy link
Copy Markdown
MemberAuthor

I merged #150432. It created conflicts. Can you please update your PR to solve conflicts?

Done.

HAVE_DOUBLE_ROUNDING = (x + y == 1e16 + 4)
skip_if_double_rounding = unittest.skipIf(HAVE_DOUBLE_ROUNDING,
"accuracy not guaranteed on "
"machines with double rounding")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all tests use @skip_if_double_rounding, I don't think that it's useful to expose HAVE_DOUBLE_ROUNDING variable. I suggest removing unused variables:

del x, y, HAVE_DOUBLE_ROUNDING

@vstinner
vstinner merged commit b6bae53 into python:mainMay 28, 2026
49 checks passed
@vstinner

Copy link
Copy Markdown
Member

Merged, thanks for the change. It's good to share code between tests.

@skirpichev
skirpichev deleted the test-support-double-rounding branch May 28, 2026 11:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@skirpichev@vstinner