GH-103804: Add test for dis.disco#103901
Conversation
|
|
|
If we decide to deprecate disco then we will turn it into a function that issues a deprecation warning and calls disassemble. Then the test that they are the same function would no longer be correct. |
Hmm, that makes sense as |
Lib/test/test_dis.py
Outdated
| with contextlib.redirect_stdout(disco_output): | ||
| dis.disco(func.__code__) | ||
| self.assertEqual(disassemble_output, disco_output.getvalue()) | ||
|
|
There was a problem hiding this comment.
We could, instead of adding this test, add a check in do_disassembly_test that disco gives the expected output as well. That would cover more cases.
There was a problem hiding this comment.
@iritkatriel I've updated the PR to reflect your suggestion. Please let me know if you have any other suggestions.
PR to test
dis.discoFixes #103804