[issue7559] TestLoader.loadTestsFromName swallows import errors
report at bugs.python.org
Sat Apr 21 16:19:10 CEST 2012
Michael Foord <michael at voidspace.org.uk> added the comment:
My favoured fix is to catch the exception and generate a failing test that re-raises the *original exception* (with traceback) when run. That way a single failing module doesn't kill a whole test run (although it does mean later feedback about misspelt imports). It also means (the main problem being reported here) that unittest no longer masks exceptions whilst importing test modules.
This would be a new feature / api change - so it would be Python 3.3 only (but it would go into unittest2).
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list