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

> Being 'runtime' rather than 'buildtime' seemed more precise - tests that
> are not meant to be build-time dependent use run-time status while
> leaving sys.platform for concerns that are directly related to builds

This is a good point - perhaps we need both?

Many of the current test skips are related to build-time switches, but indeed, 
some relate to the runtime environment.

One aspect I'm keeping in mind here is that with the Windows Subsystem for 
Linux, many lines are becoming blurred with respect to which build of Python 
people are using (I'm already getting bug reports from people who thought they 
were getting the Windows build but actually the Linux one, or vice versa). And 
mismatching builds causes some weird problems. Being able to clearly identify 
"Windows build + WSL environment" or "Linux build + WSL environment" will 
likely matter more over time.

It would be nice to have all the checks centralized, perhaps a set of 
decorators in a test.requires module?

@test.requires.linux_platform
@test.requires.darwin_platform
@test.requires.macos_runtime(10, 9)
def test_my_test(self): ...

(It would require some clever decorator design, but we can make those work like 
"ORs" rather than "ANDs".)

Does it provide any benefit? I think it's clever, but that doesn't mean it's 
worthwhile :) Using skipIf and skipUnless with test.support.CONSTANTS is just 
as readable and just as obvious (once we're using them consistently).

<End brainstorming>

----------

_______________________________________
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