-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
test_dis should test the dis module, not everything else #90916
Comments
<rant> This is getting really annoying. Tiny changes in the calling sequence, or reordering CFGs, cause huge diffs in the test_dis module. I've put this under "enhancement" as there is no "wastes a huge amount of time" category. </rant> The test_dis should not:
This is not a new problem, but it does seem to be getting progressively worse. A lot of the irritation stems from |
With IDLE, I have issues with trying to test IDLE code without retesting tkinter, as well as deciding on the proper units of behavior to test. Some suggestions:
expected_opinfo_outer = [
Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=3, argrepr='3', offset=0, starts_line=2, is_jump_target=False),
Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=3, starts_line=None, is_jump_target=False),
...
] condensed to expected_opinfo_outer = [Instruction(opname, opcode, arg, argval, argrepr,
offset, starts_line, is_jumps_target)
for opname, opcode, arg, argval, argrepr, offset, starts_line, is_jumps_target in
(('LOAD_CONST', 100, 1, 3, '3', 0, 2, False),
('LOAD_CONST', 100, 2, 4, '4', 3, None, False),
...
)] |
i'm interested in working on this (and refactoring dis to support better testability if needed). i like @terryjreedy 's ideas in general so i can start by implementing some of them. |
I think the most complex part of this issue is to make sure that the things that are covered by test_dis (and which do not belong there) are covered by other tests. Only then we can reduce test_dis to the right scope. |
…test_dis * Use a table with aligned elements rather than a list of `Instruction(key=value, ...)` constructors * Don't specify `positions=None` since it never changes. * Shorten overly-long string literals in test code. * Fix the one test that depends on its own line number.
I added checkboxes to Mark's todo list in the initial post. The first item is already fixed. |
there are still offsets in the |
by this:
do you mean that we should always be matching the structured output of |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: