Skip to content

gh-110332: Remove mentions of random.WichmannHill from test_zlib - #110334

Merged
vstinner merged 1 commit into
python:mainfrom
sobolevn:issue-110332
Oct 4, 2023
Merged

gh-110332: Remove mentions of random.WichmannHill from test_zlib#110334
vstinner merged 1 commit into
python:mainfrom
sobolevn:issue-110332

Conversation

@sobolevn

@sobolevnsobolevn commented Oct 4, 2023

Copy link
Copy Markdown
Member

Related to #110171, I am looking through other usages of Random.seed

@sobolevn
sobolevn requested a review from vstinnerOctober 4, 2023 08:31
@bedevere-appbedevere-appBot added tests Tests in the Lib/test dir awaiting review labels Oct 4, 2023
Comment threadLib/test/test_zlib.py
gen = random
gen.seed(1)
data = gen.randbytes(17 * 1024)
data = random.randbytes(17 * 1024)

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.

Instead of generating random bytes at each run, would it make sense to install Python 2.3, generate these 17 KiB, save them in a file, and use the file in this test?

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.

It will take about 500 lines for hex-encoded or base64-encoded data (more if use the bytes literal). Generating 17KB of random data takes less than 0.0001 sec.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@vstinner I've recently checked that it is not possible to install anything below python3.7 on m2 #110013 (comment)

@serhiy-storchakaserhiy-storchaka 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.

Nice catch.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @sobolevn for the PR, and @vstinner for merging it 🌮🎉.. 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 Oct 4, 2023
…zlib` (pythonGH-110334)
(cherry picked from commit e9f2352)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 4, 2023
…zlib` (pythonGH-110334)
(cherry picked from commit e9f2352)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.11 only security fixes label Oct 4, 2023
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Oct 4, 2023
vstinner pushed a commit that referenced this pull request Oct 4, 2023
…_zlib` (GH-110334) (#110348)
gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334)
(cherry picked from commit e9f2352)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
vstinner pushed a commit that referenced this pull request Oct 4, 2023
…_zlib` (GH-110334) (#110349)
gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334)
(cherry picked from commit e9f2352)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
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.

4 participants

@sobolevn@miss-islington@vstinner@serhiy-storchaka