Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-92886: Fixing tests that fail when running with optimizations (-O) in test_dis.py #93238

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,11 +1041,6 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
return output.getvalue()


if sys.flags.optimize:
code_info_consts = "0: None"
else:
code_info_consts = "0: 'Formatted details of methods, functions, or code.'"

code_info_code_info = f"""\
Name: code_info
Filename: (.*)
Expand All @@ -1056,7 +1051,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
Stack size: \\d+
Flags: OPTIMIZED, NEWLOCALS
Constants:
{code_info_consts}
0: 'Formatted details of methods, functions, or code.'
Names:
0: _format_code_info
1: _get_code_object
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixing tests that fail when running with optimizations (``-O``) in ``test_dis.py``.