Skip to content

gh-135376: Fix and improve test_random #135377

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

Merged
merged 2 commits into from
Jun 18, 2025

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 11, 2025

  • Remove duplicated code. Tests for Random and SystemRandom now share the code.
  • Move implementation agnostic tests that was only run for SystemRandom, so they are now run for Random too.
  • Add tests for __index__() support.
  • Add tests for randint().

@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 11, 2025
* Remove duplicated code. Tests for Random and SystemRandom now share
  the code.
* Move implementation agnostic tests that was only run for SystemRandom,
  so they are now run for Random too.
* Add tests for __index__() support.
* Add tests for randint().
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@rhettinger rhettinger removed needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 16, 2025
@rhettinger rhettinger removed their request for review June 16, 2025 23:53
@serhiy-storchaka serhiy-storchaka merged commit c555123 into python:main Jun 18, 2025
42 checks passed
@serhiy-storchaka serhiy-storchaka deleted the test-random branch June 18, 2025 15:26
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label Jun 18, 2025
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 18, 2025
* Remove duplicated code. Tests for Random and SystemRandom now share
  the code.
* Move implementation agnostic tests that was only run for SystemRandom,
  so they are now run for Random too.
* Add tests for __index__() support.
* Add tests for randint().
(cherry picked from commit c555123)

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

bedevere-app bot commented Jun 18, 2025

GH-135680 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jun 18, 2025
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.13 bugs and security fixes label Jun 18, 2025
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker c55512311b7cb8b7c27c19f56cd8f872be29aedc 3.13

@serhiy-storchaka serhiy-storchaka removed the needs backport to 3.13 bugs and security fixes label Jun 18, 2025
serhiy-storchaka added a commit that referenced this pull request Jun 18, 2025
* Remove duplicated code. Tests for Random and SystemRandom now share
  the code.
* Move implementation agnostic tests that was only run for SystemRandom,
  so they are now run for Random too.
* Add tests for __index__() support.
* Add tests for randint().
(cherry picked from commit c555123)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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.

3 participants