Context manager for background command-line programs
Project description
===========
Process Wrapper
===========
Process Wrapper is a simple module that executes a command-line style
program via a context manager. This is useful if you want your script
to do something that relies on a background process.
This module is conceived because of a need to automate the setup and
teardown of the Django server when running Robotframework tests. Sample
usage would look like this::
#!/usr/bin/env python
import robot
from process_wrapper import run_process
with run_process('python manage.py runserver'):
robot.run('blackbox_test.robot')
Right now, the process being run is forcefully terminated with a SIGKILL
or equivalent signal on context exit. Caution is advised.
Dependencies
=========
psutil
For running tests
-------------
1. nose (for running tests conveniently, not essential)
2. mock
Thanks to
=========
`jung rhew <http://stackoverflow.com/users/821632/jung-rhew>` for providing
the `basis of process teardown code that I used<http://stackoverflow.com/a/27034438>`
Process Wrapper
===========
Process Wrapper is a simple module that executes a command-line style
program via a context manager. This is useful if you want your script
to do something that relies on a background process.
This module is conceived because of a need to automate the setup and
teardown of the Django server when running Robotframework tests. Sample
usage would look like this::
#!/usr/bin/env python
import robot
from process_wrapper import run_process
with run_process('python manage.py runserver'):
robot.run('blackbox_test.robot')
Right now, the process being run is forcefully terminated with a SIGKILL
or equivalent signal on context exit. Caution is advised.
Dependencies
=========
psutil
For running tests
-------------
1. nose (for running tests conveniently, not essential)
2. mock
Thanks to
=========
`jung rhew <http://stackoverflow.com/users/821632/jung-rhew>` for providing
the `basis of process teardown code that I used<http://stackoverflow.com/a/27034438>`
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
process-wrapper-0.1.0.zip
(7.7 kB
view details)
File details
Details for the file process-wrapper-0.1.0.zip.
File metadata
- Download URL: process-wrapper-0.1.0.zip
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29b45791c540ab21d7fc02b9105365488ec1f004941310f42c850beae52cc86
|
|
| MD5 |
374d99c43ed94bf77b4107e971e1c1fd
|
|
| BLAKE2b-256 |
f9bad980f62832c5b3e0b12bf978ac6e80e254fb8887f36607a01a6590a624e9
|