bpo-31904 : Add support for VxWorks RTOS by kuhlenough · Pull Request #4184 · python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sprinkling verbose tests like this throughout the code is not the way. Instead, you should define a global flag at the top of the module, named based on the feature that is not on VxWorks. E.g.
_HAVE_HOME = 'vxworks' not in sys.platform
Then, for the test functions:
@unittest.skipIf(not _HAVE_HOME)
Better yet perhaps is to add those flags to a central module, e.g. platform
. Doing it this way makes it more clear what is going on. Also, if a new platform is added, the tests for platform specific features becomes easier to understand.