Skip to content

bpo-42247: fix unittest.assertRaises bug where traceback entries were…#23687

Closed
iritkatriel wants to merge 1 commit into
python:masterfrom
iritkatriel:bpo-25573
Closed

bpo-42247: fix unittest.assertRaises bug where traceback entries were…#23687
iritkatriel wants to merge 1 commit into
python:masterfrom
iritkatriel:bpo-25573

Conversation

@iritkatriel
Copy link
Copy Markdown
Member

@iritkatriel iritkatriel commented Dec 8, 2020

… dropped from the chained exception

Unittest applies a hack that uses the limit parameter of TracebackException to hide traceback frames from the unittest code itself. The problem with this is that the limit applies to the chained (context) exception too, so we lose frames we want to keep.

This patch replaces the hack by code that modifies the traceback to remove the frames we don't want.

https://bugs.python.org/issue42247

@iritkatriel iritkatriel changed the title bpo-25573: fix unittest.assertRaises bug where traceback entries were… bpo-42247: fix unittest.assertRaises bug where traceback entries were… Dec 8, 2020
@iritkatriel iritkatriel closed this Dec 8, 2020
@iritkatriel
Copy link
Copy Markdown
Member Author

sorry about the noise - I need to fix the branch name.

@iritkatriel iritkatriel deleted the bpo-25573 branch December 8, 2020 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants