From d0eff3c214b4940cb30ec1152fcabf0f34f49194 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 15 Oct 2009 22:18:38 -0400 Subject: When testing, the signal.pause() is a problem because the TestableMaster is never killed with a signal. In the real-world, it is though. So put the .pause() in a method that can be overridden by TestableMaster. --- src/mailman/testing/helpers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mailman/testing/helpers.py') diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py index 7c225d788..a54e26c82 100644 --- a/src/mailman/testing/helpers.py +++ b/src/mailman/testing/helpers.py @@ -140,6 +140,12 @@ class TestableMaster(Master): self.thread.daemon = True self._started_kids = None + def _pause(self): + """See `Master`.""" + # No-op this because the tests generally do not signal the master, + # which would mean the signal.pause() never exits. + pass + def start(self, *qrunners): """Start the master.""" self.start_qrunners(qrunners) @@ -162,7 +168,7 @@ class TestableMaster(Master): try: os.kill(pid, 0) starting_kids.remove(pid) - except OSError, error: + except OSError as error: if error.errno == errno.ESRCH: # The child has not yet started. pass -- cgit v1.2.3-70-g09d2