Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-89392: Make test_decimal discoverable #106209

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 28, 2023

It is very peculiar test file. It provides additional CLI interface and programming interface which accept options to control what to test what print during testing.

This PR is different from Zachary's patch for #64207. It only makes minimal changes necessary to make tests discoverable, use standard unittest methods to collect and run tests, and avoid changing the current behavior. The code of the module can be improved further, but this is out of the scope of this PR.

The two modified tests depended on the order in which the tests were ran.

Copy link
Member

@zware zware left a comment

Choose a reason for hiding this comment

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

LGTM. As you said, there's more cleanup to be done here, but splitting out just the discoverability fixes makes a lot of sense; I tried to do too much in my old attempt :)

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

This is a very nice cleanup; thanks, Serhiy!

python -m test test_decimal -m "<regex>" -v now finally behaves as expected.

Lib/test/test_decimal.py Show resolved Hide resolved
@serhiy-storchaka serhiy-storchaka merged commit 0e24499 into python:main Jun 29, 2023
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @serhiy-storchaka, I had trouble checking out the 3.12 backport branch.
Please retry by removing and re-adding the "needs backport to 3.12" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 0e24499129f3917b199a6d46fa33eeedd2c447fc 3.12

@serhiy-storchaka serhiy-storchaka deleted the test_decimal branch June 29, 2023 09:53
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 29, 2023
(cherry picked from commit 0e24499)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

GH-106229 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jun 29, 2023
@serhiy-storchaka serhiy-storchaka removed the needs backport to 3.12 bug and security fixes label Jun 29, 2023
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.12 bug and security fixes label Jun 29, 2023
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 29, 2023
(cherry picked from commit 0e24499)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

GH-106230 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Jun 29, 2023
@zware
Copy link
Member

zware commented Jun 29, 2023

Only took 10 years, but we got there! Thanks Serhiy :)

ambv pushed a commit that referenced this pull request Jul 5, 2023
gh-89392: Make test_decimal discoverable (GH-106209)
(cherry picked from commit 0e24499)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
ambv pushed a commit that referenced this pull request Jul 5, 2023
(cherry picked from commit 0e24499)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka removed their assignment Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants