Skip to content

Fix test_render_debug_better_error_message_recursion_error failure with variable frame widths - #546

Open
00200200 wants to merge 1 commit into
python-poetry:mainfrom
00200200:fix/test-recursion-error-frame-width
Open

00200200 wants to merge 1 commit into
python-poetry:mainfrom
00200200:fix/test-recursion-error-frame-width

Conversation

@00200200

Copy link
Copy Markdown

In test_render_debug_better_error_message_recursion_error, line numbers and repeated frame counts are right-aligned to max_frame_length = len(str(remaining_frames_length)). On platforms like PyPy or when recursion depth exceeds 999 frames, max_frame_length is 4 or more digits, leading to additional indentation before the code lines and repeated frame marker ....

Use \s+ and \s*\.\.\. in the regex pattern to accommodate variable frame count widths while continuing to strictly validate the formatted stack trace.

Fixes #386.

…ry#386)

In test_render_debug_better_error_message_recursion_error, line numbers and repeated frame counts are right-aligned to max_frame_length = len(str(remaining_frames_length)). On platforms like PyPy or when recursion depth exceeds 999 frames, max_frame_length is 4 or more digits, leading to additional indentation before the code lines and repeated frame marker '...'.

Use \s+ and \s*\.\.\. in the regex pattern to accommodate variable frame count widths while continuing to strictly validate the formatted stack trace.

Fixes python-poetry#386.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyPy3.10: tests/ui/test_exception_trace.py::test_render_debug_better_error_message_recursion_error fails

1 participant