[New-bugs-announce] [issue16935] unittest should understand SkipTest at import time during test discovery
Brett Cannon
report at bugs.python.org
Fri Jan 11 15:43:08 CET 2013
New submission from Brett Cannon:
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
----------
assignee: michael.foord
components: Library (Lib)
messages: 179681
nosy: brett.cannon, michael.foord
priority: normal
severity: normal
stage: test needed
status: open
title: unittest should understand SkipTest at import time during test discovery
type: behavior
versions: Python 3.4
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16935>
_______________________________________
More information about the New-bugs-announce
mailing list