[Zope-CVS] CVS: Packages/Zope2+3 - test.py:1.3
Jeremy Hylton
jeremy at zope.com
Tue Mar 16 00:20:59 EST 2004
Update of /cvs-repository/Packages/Zope2+3
In directory cvs.zope.org:/tmp/cvs-serv28437
Modified Files:
test.py
Log Message:
Simplify.
Uniform handling of errors in get_suite() allows this code to be
simplified.
=== Packages/Zope2+3/test.py 1.2 => 1.3 ===
--- Packages/Zope2+3/test.py:1.2 Mon Mar 15 12:29:21 2004
+++ Packages/Zope2+3/test.py Tue Mar 16 00:20:58 2004
@@ -17,6 +17,8 @@
Test harness.
+XXX explain what the test harness does.
+
-a level
--all
Run the tests at the given level. Any test at a level at or below this is
@@ -550,20 +552,10 @@
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
- except AttributeError:
- result.addError(PseudoTestCase(modname), sys.exc_info())
- return None
- try:
- return suite_func()
+ return mod.test_suite()
except:
result.addError(PseudoTestCase(modname), sys.exc_info())
return None
-
def filter_testcases(s, rx):
new = unittest.TestSuite()
More information about the Zope-CVS
mailing list