bpo-28009: Fix SkipUnless logic to be based on platform programs capable of introspection by aixtools · Pull Request #12777 · python/cpython (original) (raw)
Thanks for a suggestion - for a better way @ncoghlan
Rather than try and get everything in one PR - a mountain to steep for me - I am going to take what I hope is the most simple part of my previous PR's on this PR8672 - still open and PR5183 (which I closed and started over again).
I will continue on PR8672 - but there the focus will be on Lib/uuid.py rather than Lib/test/test_uuid.py
I expect comments:
a) I am using platform.system() rather than sys.platform(.startswith)
b) I have identified four specific platforms (AIX, Darwin, Linux, Windows). Maybe more is needed, or a different default definition for _NODE_GETTERS when not a recognized platform.
c) prepending either _unix_getnode, or windll_getnode to NODE_GETTERS rather than repeat it several times. Not sure what is most "PEP8" specification.
d) In the class BaseTestInternals I removed the statement "uuid = None", better replaced it with _uuid = py_uuid so that the skipUnless statements could find what they need. Maybe "uuid = None" is still needed. However, it seems to unreferenced (as self.uuid is used for the selection of internal or external uuid module actually called)
In the hope this can move forward in steps - the patch focusing on SkipUnless - and getting the real commands that need to be tested right (in NODE_GETTERS).