-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-92118: Add test for traceback when exception is modified by ExitStack.__exit__ #92339
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
Conversation
…ExitStack.__exit__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the same in 3.10?
Lib/test/test_contextlib.py
Outdated
|
||
self.assertIsInstance(exc, ValueError) | ||
ve_frames = traceback.extract_tb(exc.__traceback__) | ||
self.assertEqual(len(ve_frames), 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is redundant, And if it fail, the report will be less informative than failing the test which compares lists.
It is. |
Hmm. contextlib_async tests use this test and get a different traceback. |
You can parametrize the test. Set the expected result as an attribute of the class. |
Thanks. The 3.10 backport will fail because it doesn't have import traceback, but I'll fix it. |
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…(Async)ExitStack.__exit__ (pythonGH-92339) (cherry picked from commit e65e587) Co-authored-by: Irit Katriel <[email protected]>
GH-92343 is a backport of this pull request to the 3.10 branch. |
No description provided.