[Buildbot-commits] buildbot/buildbot/test test_control.py, 1.9, 1.10 test_vc.py, 1.62, 1.63

Brian Warner warner at users.sourceforge.net
Tue Jun 20 08:08:19 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14486/buildbot/test

Modified Files:
	test_control.py test_vc.py 
Log Message:
[project @ more SignalMixin refactoring]

Original author: warner at lothar.com
Date: 2006-06-16 17:08:55

Index: test_control.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_control.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- test_control.py	14 Oct 2005 19:47:58 -0000	1.9
+++ test_control.py	20 Jun 2006 08:08:17 -0000	1.10
@@ -12,6 +12,7 @@
 from buildbot.status import builder
 from buildbot.status.builder import SUCCESS
 from buildbot.process import base
+from buildbot.test.runutils import SignalMixin, rmtree
 
 config = """
 from buildbot.process import factory, step
@@ -37,30 +38,11 @@
     def getSlaveCommandVersion(self, command, oldversion=None):
         return "1.10"
 
-class SignalMixin:
-    sigchldHandler = None
-    
-    def setUpClass(self):
-        # make sure SIGCHLD handler is installed, as it should be on
-        # reactor.run(). problem is reactor may not have been run when this
-        # test runs.
-        if hasattr(reactor, "_handleSigchld") and hasattr(signal, "SIGCHLD"):
-            self.sigchldHandler = signal.signal(signal.SIGCHLD,
-                                                reactor._handleSigchld)
-    
-    def tearDownClass(self):
-        if self.sigchldHandler:
-            signal.signal(signal.SIGCHLD, self.sigchldHandler)
 
 class Force(unittest.TestCase):
 
     def rmtree(self, d):
-        try:
-            shutil.rmtree(d, ignore_errors=1)
-        except OSError, e:
-            # stupid 2.2 appears to ignore ignore_errors
-            if e.errno != errno.ENOENT:
-                raise
+        rmtree(d)
 
     def setUp(self):
         self.master = None

Index: test_vc.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- test_vc.py	16 Jun 2006 05:41:22 -0000	1.62
+++ test_vc.py	20 Jun 2006 08:08:17 -0000	1.63
@@ -22,6 +22,7 @@
 from buildbot.sourcestamp import SourceStamp
 from buildbot.twcompat import maybeWait, which
 from buildbot.scripts import tryclient
+from buildbot.test.runutils import SignalMixin
 
 #step.LoggedRemoteCommand.debug = True
 
@@ -259,21 +260,6 @@
 
 VCS = VCS_Helper()
 
-class SignalMixin:
-    sigchldHandler = None
-    
-    def setUpClass(self):
-        # make sure SIGCHLD handler is installed, as it should be on
-        # reactor.run(). problem is reactor may not have been run when this
-        # test runs.
-        if hasattr(reactor, "_handleSigchld") and hasattr(signal, "SIGCHLD"):
-            self.sigchldHandler = signal.signal(signal.SIGCHLD,
-                                                reactor._handleSigchld)
-    
-    def tearDownClass(self):
-        if self.sigchldHandler:
-            signal.signal(signal.SIGCHLD, self.sigchldHandler)
-
 
 # the overall plan here:
 #





More information about the Commits mailing list