Skip to content

gh-125522: Remove bare except in test_zlib.test_flushes#126321

Merged
corona10 merged 5 commits into
python:mainfrom
simple-is-great:test_zlib
Nov 2, 2024
Merged

gh-125522: Remove bare except in test_zlib.test_flushes#126321
corona10 merged 5 commits into
python:mainfrom
simple-is-great:test_zlib

Conversation

@simple-is-great

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

Copy link
Copy Markdown
Contributor

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

@ghost

ghost commented Nov 2, 2024

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app

bedevere-app Bot commented Nov 2, 2024

Copy link
Copy Markdown

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

bedevere-app Bot commented Nov 2, 2024

Copy link
Copy Markdown

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.

Comment thread Lib/test/test_zlib.py Outdated
@simple-is-great

Copy link
Copy Markdown
Contributor Author

cc: @corona10

@corona10

corona10 commented Nov 2, 2024

Copy link
Copy Markdown
Member

@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

@skirpichev skirpichev 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.

One formatting nitpick, otherwise LGTM.

Comment thread Lib/test/test_zlib.py Outdated
Comment thread Lib/test/test_zlib.py Outdated
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>

@corona10 corona10 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

@corona10 corona10 enabled auto-merge (squash) November 2, 2024 08:07
@corona10 corona10 added needs backport to 3.12 only 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
@miss-islington-app

Copy link
Copy Markdown

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
…gh-126321)

(cherry picked from commit cfb1b2f)

Co-authored-by: simple-is-great <103080930+simple-is-great@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 2, 2024
…gh-126321)

(cherry picked from commit cfb1b2f)

Co-authored-by: simple-is-great <103080930+simple-is-great@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Nov 2, 2024

Copy link
Copy Markdown

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

bedevere-app Bot commented Nov 2, 2024

Copy link
Copy Markdown

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 only 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 <103080930+simple-is-great@users.noreply.github.com>
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 <103080930+simple-is-great@users.noreply.github.com>
@simple-is-great simple-is-great deleted the test_zlib branch November 2, 2024 08:59
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
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