Éric Araujo added the comment:

FTR there is already an alternative to setupmodule:

try:
    import module
except ImportError:
    module = None

@unittest.skipUnless(module, 'requires module')
class ModuleTests(unittest.TestCase):
    pass


This idiom is more lines than support.import_module, but works for non-stdlib 
tests too, and is useful when you don’t want the whole file to be skipped if 
the module is missing (like in distutils’ test_sdist where zlib can be missing).

----------
nosy: +eric.araujo

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

Reply via email to