[Buildbot-commits] buildbot/buildbot twcompat.py,1.3,1.4

Brian Warner warner at users.sourceforge.net
Mon Apr 17 20:43:48 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21569/buildbot

Modified Files:
	twcompat.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-502
Creator:  Brian Warner <warner at lothar.com>

handle SkipTest properly under Twisted-1.3.0

	* buildbot/twcompat.py (maybeWait): handle SkipTest properly when
	running under Twisted-1.3.0, otherwise skipped tests are reported
	as errors.


Index: twcompat.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/twcompat.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- twcompat.py	16 Apr 2006 23:05:41 -0000	1.3
+++ twcompat.py	17 Apr 2006 20:43:46 -0000	1.4
@@ -45,15 +45,21 @@
 
 # use this at the end of setUp/testFoo/tearDown methods
 def maybeWait(d, timeout="none"):
+    from twisted.python import failure
     from twisted.trial import unittest
     if oldtrial:
         # this is required for oldtrial (twisted-1.3.0) compatibility. When we
         # move to retrial (twisted-2.0.0), replace these with a simple 'return
         # d'.
-        if timeout == "none":
-            unittest.deferredResult(d)
-        else:
-            unittest.deferredResult(d, timeout)
+        try:
+            if timeout == "none":
+                unittest.deferredResult(d)
+            else:
+                unittest.deferredResult(d, timeout)
+        except failure.Failure, f:
+            if f.check(unittest.SkipTest):
+                raise f.value
+            raise
         return None
     return d
 





More information about the Commits mailing list