[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/tests.py adding a test running module that works with zope.testing.testrunner

david whitfield Morriss whit at longnow.org
Mon Aug 28 15:50:25 EDT 2006


Log message for revision 69815:
  adding a test running module that works with zope.testing.testrunner
  

Changed:
  A   Zope/branches/2.9/lib/python/Testing/ZopeTestCase/tests.py

-=-
Added: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/tests.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/tests.py	2006-08-28 18:32:39 UTC (rev 69814)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/tests.py	2006-08-28 19:50:25 UTC (rev 69815)
@@ -0,0 +1,22 @@
+"""test runner that works with zope.testing.testrunner"""
+import unittest
+import os, sys
+
+import os, sys
+
+suite = unittest.TestSuite()
+
+names = os.listdir(os.path.dirname(__file__))
+tests = [x[:-3] for x in names \
+         if x.startswith('test') and x.endswith('.py') \
+         and not x == 'tests.py']
+
+import Testing.ZopeTestCase
+for test in tests:
+    m = __import__("Testing.ZopeTestCase.%s" %test)
+    m = getattr(Testing.ZopeTestCase, test)
+    if hasattr(m, 'test_suite'):
+        suite.addTest(m.test_suite())
+
+def test_suite():
+    return suite



More information about the Zope-Checkins mailing list