[Zodb-checkins] CVS: ZEO/ZEO/tests - testZEO.py:1.16.4.4.2.12

Jeremy Hylton jeremy@zope.com
Thu, 30 May 2002 18:07:48 -0400


Update of /cvs-repository/ZEO/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv12818

Modified Files:
      Tag: ZEO2-branch
	testZEO.py 
Log Message:
get rid of some unit test mechanism kludges


=== ZEO/ZEO/tests/testZEO.py 1.16.4.4.2.11 => 1.16.4.4.2.12 ===
         zLOG.LOG("checkReconnection", zLOG.INFO, "finished")
 
-def get_methods(klass):
-    l = [klass]
-    meth = {}
-    while l:
-        klass = l.pop(0)
-        for base in klass.__bases__:
-            l.append(base)
-        for k, v in klass.__dict__.items():
-            if callable(v):
-                meth[k] = 1
-    return meth.keys()
-
 if os.name == "posix":
     test_classes = ZEOFileStorageTests, ConnectionTests
 elif os.name == "nt":
@@ -390,18 +378,12 @@
 else:
     raise RuntimeError, "unsupported os: %s" % os.name
 
-def makeTestSuite(testname=''):
+def test_suite():
     suite = unittest.TestSuite()
-    name = 'check' + testname
-    lname = len(name)
     for klass in test_classes:
-        for meth in get_methods(klass):
-            if meth[:lname] == name:
-                suite.addTest(klass(meth))
+        sub = unittest.makeSuite(klass, 'check')
+        suite.addTest(sub)
     return suite
-
-def test_suite():
-    return makeTestSuite()
 
 def main():
     import sys, getopt