Steve Dower <steve.do...@python.org> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36624>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to