[Checkins] SVN: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/ Made runalltests skip 'tests.py' when running ZTC tests.

Stefan H. Holek stefan at epy.co.at
Sat Sep 2 10:40:20 EDT 2006


Log message for revision 69930:
  Made runalltests skip 'tests.py' when running ZTC tests.
  

Changed:
  U   Zope/branches/2.9/lib/python/Testing/ZopeTestCase/runalltests.py
  U   Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py

-=-
Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/runalltests.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/runalltests.py	2006-09-02 14:38:10 UTC (rev 69929)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/runalltests.py	2006-09-02 14:40:19 UTC (rev 69930)
@@ -27,12 +27,16 @@
 import unittest
 TestRunner = unittest.TextTestRunner
 suite = unittest.TestSuite()
+cwd = os.getcwd()
 
 def test_finder(recurse, dir, names):
     if dir == os.curdir or '__init__.py' in names:
         parts = [x for x in dir[len(os.curdir):].split(os.sep) if x]
         tests = [x for x in names if x.startswith('test') and x.endswith('.py')]
         for test in tests:
+            if test == 'tests.py' and 'ZopeTestCase' in cwd:
+                # Skip tests.py when running ZTC tests
+                continue
             modpath = parts + [test[:-3]]
             m = __import__('.'.join(modpath))
             for part in modpath[1:]:

Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py	2006-09-02 14:38:10 UTC (rev 69929)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py	2006-09-02 14:40:19 UTC (rev 69930)
@@ -27,12 +27,16 @@
 import unittest
 TestRunner = unittest.TextTestRunner
 suite = unittest.TestSuite()
+cwd = os.getcwd()
 
 def test_finder(recurse, dir, names):
     if dir == os.curdir or '__init__.py' in names:
         parts = [x for x in dir[len(os.curdir):].split(os.sep) if x]
         tests = [x for x in names if x.startswith('test') and x.endswith('.py')]
         for test in tests:
+            if test == 'tests.py' and 'ZopeTestCase' in cwd:
+                # Skip tests.py when running ZTC tests
+                continue
             modpath = parts + [test[:-3]]
             m = __import__('.'.join(modpath))
             for part in modpath[1:]:



More information about the Checkins mailing list