This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients Michael.Felt, ned.deily, steve.dower, taleinat
Date 2019-06-05.13:33:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559741612.32.0.813817348938.issue36624@roundup.psfhosted.org>
In-reply-to
Content
The reason I'd prefer sys.platform in most cases is because it's a compile-time constant, based on the one that includes/excludes APIs near completely, and most of our tests ought to be switching on these.

I personally don't see any need to switch on os.name, except perhaps in the tests for that module.

But if we start skipping tests based on platform(), then we will miss out on seeing new failures on new platforms. This is a real concern, as I have colleagues currently adding Windows on ARM and ARM64 support, and since the API is the same we expect everything to work. It doesn't, of course, but that's what specific exclusions are for.

If I were to propose a consistent scheme for this, I'd suggest:
* include tests based on sys.platform
* skip tests based on platform module

So if some functionality only exists when MS_WINDOWS was defined, we check sys.platform == win32. But if it doesn't work on ARM, we check platform.platform == (whatever the value is).

That way, adding new platforms will get the maximum amount of tests initially.
History
Date User Action Args
2019-06-05 13:33:32steve.dowersetrecipients: + steve.dower, taleinat, ned.deily, Michael.Felt
2019-06-05 13:33:32steve.dowersetmessageid: <1559741612.32.0.813817348938.issue36624@roundup.psfhosted.org>
2019-06-05 13:33:32steve.dowerlinkissue36624 messages
2019-06-05 13:33:32steve.dowercreate