Package list python-procrunner / a3dd89b4-8153-48f2-90d8-344f6ad0de0f/main docs / usage.rst

Tree @a3dd89b4-8153-48f2-90d8-344f6ad0de0f/main (Download .tar.gz)

usage.rst @a3dd89b4-8153-48f2-90d8-344f6ad0de0f/mainraw · history · blame


To use ProcRunner in a project::

    import procrunner
    result =['/bin/ls', '/some/path/containing spaces'])

To test for successful completion::

    assert not result['exitcode']
    assert result['exitcode'] == 0 # alternatively

To test for no STDERR output::

    assert not result['stderr']
    assert result['stderr'] == b'' # alternatively

To run with a specific environment variable set::

    result =, environment_override={ 'VARIABLE': 'value' })

To run with a specific environment::

    result =, environment={ 'VARIABLE': 'value' })

To run in a specific directory::

    result =, working_directory='/some/path')