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-125522: Remove bare except in test_zlib.test_flushes #126321

Merged
merged 5 commits into from
Nov 2, 2024

Conversation

simple-is-great
Copy link
Contributor

@simple-is-great simple-is-great commented Nov 2, 2024

This is a simple rewrite of the test to avoid bare except and make the test's intention clearer.

Copy link

cpython-cla-bot bot commented Nov 2, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Nov 2, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Nov 2, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 2, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Lib/test/test_zlib.py Outdated Show resolved Hide resolved
@simple-is-great
Copy link
Contributor Author

cc: @corona10

@corona10
Copy link
Member

corona10 commented Nov 2, 2024

@simple-is-great See the example of

with self.subTest(opcode=op, func=func):
self.assertIsInstance(func(op), bool)
self.assertEqual(func(op), expected)

@corona10 corona10 changed the title gh-125522: Fix bare except in test_zlib.test_flushes gh-125522: Remove bare except in test_zlib.test_flushes Nov 2, 2024
Copy link
Member

@skirpichev skirpichev left a comment

Choose a reason for hiding this comment

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

One formatting nitpick, otherwise LGTM.

Lib/test/test_zlib.py Outdated Show resolved Hide resolved
Lib/test/test_zlib.py Outdated Show resolved Hide resolved
Co-authored-by: Sergey B Kirpichev <[email protected]>
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

lgtm

@corona10 corona10 enabled auto-merge (squash) November 2, 2024 08:07
@corona10 corona10 added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Nov 2, 2024
@corona10 corona10 merged commit cfb1b2f into python:main Nov 2, 2024
42 checks passed
@miss-islington-app
Copy link

Thanks @simple-is-great for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 2, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 2, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 2, 2024

GH-126327 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 2, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 2, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Nov 2, 2024
corona10 pushed a commit that referenced this pull request Nov 2, 2024
…6321) (gh-126328)

gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321)
(cherry picked from commit cfb1b2f)

Co-authored-by: simple-is-great <[email protected]>
corona10 pushed a commit that referenced this pull request Nov 2, 2024
…6321) (gh-126327)

gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321)
(cherry picked from commit cfb1b2f)

Co-authored-by: simple-is-great <[email protected]>
@simple-is-great simple-is-great deleted the test_zlib branch November 2, 2024 08:59
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