Browse Source

Make **sure** multi tests doesn't actually launch workers

Ask Solem 13 years ago
parent
commit
f45f07c215
1 changed files with 5 additions and 0 deletions
  1. 5 0
      celery/bin/celeryd_multi.py

+ 5 - 0
celery/bin/celeryd_multi.py

@@ -110,6 +110,9 @@ SIGNAMES = set(sig for sig in dir(signal)
                         if sig.startswith("SIG") and "_" not in sig)
 SIGMAP = dict((getattr(signal, name), name) for name in SIGNAMES)
 
+# for tests to ensure that we don't actually launch anything
+_popen = Popen
+
 
 USAGE = """\
 usage: %(prog_name)s start <node1 node2 nodeN|range> [celeryd options]
@@ -371,6 +374,8 @@ class MultiTool(object):
     def waitexec(self, argv, path=sys.executable):
         args = " ".join([path] + list(argv))
         argstr = shellsplit(from_utf8(args))
+        if Popen == _popen:  # pragma: no cover
+            raise Exception("OH MY GOD")
         pipe = Popen(argstr, env=self.env)
         self.info("  %s" % " ".join(argstr))
         retcode = pipe.wait()