Hi Skip, On 01/02/2021 9:50 pm, Skip Montanaro wrote:
Guido> Maybe these lines in test_dis.py? ... Skip> Thanks, I'll take a look. I was expecting there'd be a standalone Skip> script somewhere. Hadn't considered that comments would be hiding Skip> code.
Indeed, that did the trick, however... I'm a bit uncomfortable with the methodology. It seems test_dis is using the same method (dis.get_instructions) to both generate the expected output and verify that dis.get_instructions works as expected. For the most part, you see the test case fails, rerun the code to generate the list, substitute, et voila! The test (magically) passes. Somewhere along the way, it seems there should be a way to alert the user that perhaps dis.get_instructions is broken and its output is not to be trusted completely.
The problem is not that dis.get_instructions can't be trusted, but that the test isn't testing the dis module at all. It is testing whether the output from the compiler has changed. A lot of the tests in test_dis do that. Cheers, Mark.
Skip _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/FAI7XYMY... Code of Conduct: http://python.org/psf/codeofconduct/