Message179700
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). |
|
Date |
User |
Action |
Args |
2013-01-11 16:29:12 | eric.araujo | set | recipients:
+ eric.araujo, brett.cannon, michael.foord, zach.ware |
2013-01-11 16:29:12 | eric.araujo | set | messageid: <1357921752.22.0.942889747261.issue16935@psf.upfronthosting.co.za> |
2013-01-11 16:29:12 | eric.araujo | link | issue16935 messages |
2013-01-11 16:29:11 | eric.araujo | create | |
|