Skip to content

Fix mistake in barry_as_FLUFL test #31392

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 1 commit into from
Feb 18, 2022
Merged

Conversation

pxeger
Copy link
Contributor

@pxeger pxeger commented Feb 17, 2022

In Lib/tests/test_flufl.py (which tests the from __future__ import barry_as_FLUFL easter-egg, there is (was) a mistake:

self.assertTrue(cm.exception.lineno, 2)

This causes cm.exception.lineno to be checked for truthiness, with 2 being unintentionally passed as the msg parameter instead. This test will therefore have false negatives, if lineno is for some reason nonzero but incorrect.

(How do I do the "skip news" and "skip issue" things for minor changes like this again?)

@miss-islington
Copy link
Contributor

Thanks @pxeger for the PR, and @sweeneyde for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 18, 2022
Use assertEqual(), not assertTrue(lineno, 2)
(cherry picked from commit 5f1c205)

Co-authored-by: Patrick Reader <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Feb 18, 2022
@bedevere-bot
Copy link

GH-31400 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 18, 2022
Use assertEqual(), not assertTrue(lineno, 2)
(cherry picked from commit 5f1c205)

Co-authored-by: Patrick Reader <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Feb 18, 2022
@bedevere-bot
Copy link

GH-31401 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request Feb 18, 2022
Use assertEqual(), not assertTrue(lineno, 2)
(cherry picked from commit 5f1c205)

Co-authored-by: Patrick Reader <[email protected]>
miss-islington added a commit that referenced this pull request Feb 18, 2022
Use assertEqual(), not assertTrue(lineno, 2)
(cherry picked from commit 5f1c205)

Co-authored-by: Patrick Reader <[email protected]>
@pxeger pxeger deleted the fix_flufl branch February 18, 2022 14:15
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
Use assertEqual(), not assertTrue(lineno, 2)
(cherry picked from commit 5f1c205)

Co-authored-by: Patrick Reader <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants