Better error message when importing test module fails

This commit is contained in:
Kovid Goyal 2013-10-23 10:27:36 +05:30
parent 07bccb9761
commit 18d5d9a3a4

View File

@ -75,6 +75,8 @@ def run_tests(find_tests=find_tests):
try:
for suite in tests:
for test in suite._tests:
if test.__class__.__name__ == 'ModuleImportFailure':
raise Exception('Failed to import a test module: %s' % test)
for s in test:
if s._testMethodName == q:
ans = s