Browse Source

Fix unused variable in test

Mike Naberezny 10 years ago
parent
commit
df76307f48
1 changed files with 5 additions and 4 deletions
  1. 5 4
      supervisor/tests/test_process.py

+ 5 - 4
supervisor/tests/test_process.py

@@ -633,10 +633,10 @@ class SubprocessTests(unittest.TestCase):
         # this is a functional test
         from supervisor.tests.base import makeSpew
         try:
-            called = 0
-            def foo(*args):
-                called = 1
-            signal.signal(signal.SIGCHLD, foo)
+            sigchlds = []
+            def sighandler(*args):
+                sigchlds.append(True)
+            signal.signal(signal.SIGCHLD, sighandler)
             executable = makeSpew()
             options = DummyOptions()
             config = DummyPConfig(options, 'spew', executable)
@@ -664,6 +664,7 @@ class SubprocessTests(unittest.TestCase):
             pid, sts = os.waitpid(-1, os.WNOHANG)
             data = os.popen('ps').read()
             self.assertEqual(data.find(repr(origpid)), -1) # dubious
+            self.assertNotEqual(sigchlds, [])
         finally:
             try:
                 os.remove(executable)