[Zope3-checkins] SVN: Zope3/branches/3.3/src/zope/component/ merge 69347 and 69348 from trunk. Fixes test problems in buildbot.

Gary Poster gary at zope.com
Fri Aug 4 01:01:55 EDT 2006


Log message for revision 69349:
  merge 69347 and 69348 from trunk.  Fixes test problems in buildbot.
  

Changed:
  U   Zope3/branches/3.3/src/zope/component/standalonetests.py
  U   Zope3/branches/3.3/src/zope/component/tests.py

-=-
Modified: Zope3/branches/3.3/src/zope/component/standalonetests.py
===================================================================
--- Zope3/branches/3.3/src/zope/component/standalonetests.py	2006-08-04 04:33:32 UTC (rev 69348)
+++ Zope3/branches/3.3/src/zope/component/standalonetests.py	2006-08-04 05:01:54 UTC (rev 69349)
@@ -3,8 +3,7 @@
 import sys
 
 if __name__ == "__main__":
-    paths = sys.argv.pop().split(':')
-    sys.path.extend(paths)
+    sys.path[:] = sys.argv.pop().split(':')
 
 from zope import interface
 from zope.component.testing import setUp, tearDown
@@ -34,7 +33,6 @@
 
       >>> import zope.component
       >>> zope.component.provideAdapter(Comp, (I1,), I2)
-      >>> res = 0 #zope.component.getAdapter
       >>> adapter = I2(ob)
       >>> adapter.__class__ is Comp
       True

Modified: Zope3/branches/3.3/src/zope/component/tests.py
===================================================================
--- Zope3/branches/3.3/src/zope/component/tests.py	2006-08-04 04:33:32 UTC (rev 69348)
+++ Zope3/branches/3.3/src/zope/component/tests.py	2006-08-04 05:01:54 UTC (rev 69349)
@@ -934,7 +934,7 @@
         import tempfile
         executable = os.path.abspath(sys.executable)
         program = os.path.join(os.path.dirname(__file__), 'standalonetests.py')
-        paths = ':'.join(sys.path)
+        paths = ':'.join(p for p in sys.path if p)
         command = "%(executable)s %(program)s %(paths)s" % {
             'executable': executable, 'program': program, 'paths': paths}
         t = tempfile.TemporaryFile()
@@ -942,8 +942,13 @@
         t.seek(0)
         lines = t.readlines()
         t.close()
-        if lines[-1][-3:-1] != 'OK':
-            self.fail(''.join(lines))
+        for l in reversed(lines):
+            l = l.strip()
+            if l:
+                if not l.endswith('OK'):
+                    self.fail(''.join(lines))
+                else:
+                    break
 
 def tearDownRegistryTests(tests):
     import zope.event



More information about the Zope3-Checkins mailing list