Commit bf27ac24 authored by Jeremy Hylton's avatar Jeremy Hylton

Simplify.

Uniform handling of errors is get_suite() allows this code to be
simplified.
parent c56d747f
......@@ -487,18 +487,10 @@ def get_suite(file, result):
modname = finder.module_from_path(file)
try:
mod = package_import(modname)
except ImportError, err:
result.addError(PseudoTestCase(modname), sys.exc_info())
return None
try:
suite_func = mod.test_suite
return mod.test_suite()
except AttributeError:
result.addError(PseudoTestCase(modname), sys.exc_info())
return None
try:
return suite_func()
except:
result.addError(PseudoTestCase(modname), sys.exc_info())
def filter_testcases(s, rx):
new = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment