-
-
Notifications
You must be signed in to change notification settings - Fork 32k
GH-103804: Add test for dis.disco #103901
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iritkatriel I've updated the PR to reflect your suggestion. Please let me know if you have any other suggestions.
PR to test
dis.disco
Fixes #103804