Skip to content

gh-119780: Adjust exception messages in Lib/test/test_format.py #119781

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 5 commits into from
May 31, 2024

Conversation

skirpichev
Copy link
Contributor

@skirpichev skirpichev commented May 30, 2024

@skirpichev

This comment was marked as resolved.

@@ -82,6 +82,7 @@ def test_exc(formatstr, args, exception, excmsg):
else:
if verbose: print('no')
print('Unexpected ', exception, ':', repr(str(exc)))
raise
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to remove this for now, and properly rewrite this function in a separate issue. This will help to backport it.

This is an ancient code which was ported to unittest. Now we can use subTest() if we want to see multiple failures.

Copy link
Member

Choose a reason for hiding this comment

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

What is the issue with backporting this change? It should work fine on 3.12 too. We can rewrite this to properly use subTest() later, but this change is small and fixes a bug that led us to miss some real test failures.

Copy link
Member

Choose a reason for hiding this comment

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

The code will be different in main and other branches, therefore conflicts, which should be resolved manually.

Copy link
Contributor Author

@skirpichev skirpichev May 31, 2024

Choose a reason for hiding this comment

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

@serhiy-storchaka, reverted. Issue description adjusted, so I don't think there should be a new issue.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Thank you for noticing these failures.

@serhiy-storchaka serhiy-storchaka merged commit b278c72 into python:main May 31, 2024
31 checks passed
@skirpichev skirpichev deleted the fix-test_format-119780 branch May 31, 2024 08:09
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…pythonGH-119781)

Mismatches were just output to the stdout, without making the test failing.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…pythonGH-119781)

Mismatches were just output to the stdout, without making the test failing.
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