skip to navigation
skip to content

mirakuru 0.2.0

Process executor for tests.

Latest Version: 0.8.3


Maybe you want to be able to start database only when you start your program, or maybe you need just to set up additional processes for your tests, this is where you should consider using mirakuru, to add superpowers to your program, or tests.

Package status


As developers, we have to work on project that rely on multiple processes to run. We guard ourselves with tests. But sometimes it’s not enough what one process sends, and the other receives. Sometimes there’s need to actually exchange data between processes. Or write selenium tests. Or maybe write a program that takes care of starting databases or other required services itself.

If so, then mirakuru is what you need.

Mirakuru starts your required process, and wait for clear indication, that it’s running. There are three basic executors with predefined conditions:

  • Executor - simply starts
  • OutputExecutor - awaits for specified output to be given by process
  • TCPExecutor - waits for ability to connect through tcp with process
  • HTTPExecutor - waits for successful HEAD request (and tcp before).
from mirakuru import HTTPExecutor
from httplib import HTTPConnection, OK

def test_it_works():
    executor = HTTPExecutor("./server", url="http://localhost:6543/")

    # start and wait for it to run
    # should be running!
    conn = HTTPConnection("localhost", 6543)
    conn.request('GET', '/')
    assert conn.getresponse().status is OK

The server command in this case is just a bash script that sleeps for some time and then launches the builtin SimpleHTTPServer on port 6543.


The project was first developed by Mateusz Lenik as summon_process. Later forked, renamed to mirakuru and tended to by The A Room @ Clearcode.


mirakuru is licensed under LGPL license, version 3.

Contributing and reporting bugs

Source code is available at: ClearcodeHQ/mirakuru. Issue tracker is located at GitHub Issues. Projects PyPi page.

When contributing, don’t forget to add your name to AUTHORS.rst file.



  • [fix] - kill all children processes of Exeutor started with shell=True
  • [feature] executors are now context managers - to start executors for given context
  • [feature] Executor.stopped - context manager for stopping executors for given context
  • [feature] HTTPExecutor and TCPExecutor before .start() check whether port is already used by other processes and raise AlreadyRunning if detects it
  • moved python version conditional imports into module


  • fix issue where setting shell to True would execute only part of the command.


  • fix issue where OutputExecutor would hang, if started process stopped producing output


  • [fix] removed leftover sleep from TCPExecutor._wait_for_connection


  • fixed
  • updated packaging options


  • exposed process attribute on Executor
  • exposed port and host on TCPExecutor
  • exposed url on HTTPExecutor
  • simplified package structure
  • simplified executors operating api
  • updated documentation
  • added docblocks for every function
  • applied license headers
  • stripped orchestrators
  • forked off from summon_process
File Type Py Version Uploaded on Size
mirakuru-0.2.0-py2.py3-none-any.whl (md5) Python Wheel 2.7 2014-08-14 14KB
mirakuru-0.2.0.tar.gz (md5) Source 2014-08-14 11KB