Process executor for tests.
Mirakuru is a process orchestration tool designed for functional and integration tests.
Maybe you want to be able to start a database before you start your program or maybe you just need to set additional services up for your tests. This is where you should consider using mirakuru to add superpowers to your program or tests.
In a project that relies on multiple processes there might be a need to guard code with tests that verify interprocess communication. So one needs to set up all of required databases, auxiliary and application services to verify their cooperation. Synchronising (or orchestrating) test procedure with tested processes might be a hell.
If so, then mirakuru is what you need.
Mirakuru starts your process and waits for the clear indication that it’s running. Library provides six executors to fit different cases:
from mirakuru import HTTPExecutor from httplib import HTTPConnection, OK def test_it_works(): # The ``./http_server`` here launches some HTTP server on the 6543 port, # but naturally it is not immediate and takes a non-deterministic time: executor = HTTPExecutor("./http_server", url="http://127.0.0.1:6543/") # Start the server and wait for it to run (blocking): executor.start() # Here the server should be running! conn = HTTPConnection("127.0.0.1", 6543) conn.request("GET", "/") assert conn.getresponse().status is OK executor.stop()
A command by which executor spawns a process can be defined by either string or list.
# command as string TCPExecutor('python -m smtpd -n -c DebuggingServer localhost:1025', host='localhost', port=1025) # command as list TCPExecutor( ['python', '-m', 'smtpd', '-n', '-c', 'DebuggingServer', 'localhost:1025'], host='localhost', port=1025 )
mirakuru is licensed under LGPL license, version 3.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|mirakuru-0.8.2-py2.py3-none-any.whl (23.5 kB) Copy SHA256 Checksum SHA256||py2.py3||Wheel||Jul 15, 2016|
|mirakuru-0.8.2.tar.gz (19.5 kB) Copy SHA256 Checksum SHA256||–||Source||Jul 15, 2016|