Message179681
For test discovery to work where a dependent module is optional, you end up needing to do something like what is done in http://hg.python.org/cpython/rev/15ddd683c321:
-crypt = support.import_module('crypt')
+def setUpModule():
+ # this import will raise unittest.SkipTest if _crypt doesn't exist,
+ # so it has to be done in setUpModule for test discovery to work
+ global crypt
+ crypt = support.import_module('crypt')
That's kind of ugly. It would be better if unittest recognized SkipTest at import time during test discovery |
|
Date |
User |
Action |
Args |
2013-01-11 14:43:08 | brett.cannon | set | recipients:
+ brett.cannon, michael.foord |
2013-01-11 14:43:08 | brett.cannon | set | messageid: <1357915388.69.0.583817209092.issue16935@psf.upfronthosting.co.za> |
2013-01-11 14:43:08 | brett.cannon | link | issue16935 messages |
2013-01-11 14:43:08 | brett.cannon | create | |
|