[issue46760] test_dis should test the dis module, not everything else
Mark Shannon
report at bugs.python.org
Tue Feb 15 09:17:08 EST 2022
New submission from Mark Shannon <mark at hotpy.org>:
<rant>
This is getting really annoying.
It takes longer to fix all the heavily coupled and poorly written tests in test_dis than to make the real changes.
Tiny changes in the calling sequence, or reordering CFGs, cause huge diffs in the test_dis module.
No one ever checks these changes, they are just noise.
I've put this under "enhancement" as there is no "wastes a huge amount of time" category.
</rant>
The test_dis should not:
Contain offsets; they turn one line diffs into 100 line diffs
Contain tests for the compiler; they belong elsewhere.
Contain big strings; write proper tests not just regex matches.
Tests for Instruction should should not depend on the compiler output; create the bytecode directly.
This is not a new problem, but it does seem to be getting progressively worse.
A lot of the irritation stems from
https://github.com/python/cpython/commit/b39fd0c9b8dc6683924205265ff43cc597d1dfb9
although the tests from before that still hardcode offsets.
----------
components: Tests
messages: 413291
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: test_dis should test the dis module, not everything else
type: enhancement
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46760>
_______________________________________
More information about the Python-bugs-list
mailing list