Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Then you run scripts with ``env.run(script, arg1, arg2, ...)``::

There's several keyword arguments you can use with ``env.run()``:

``debug``: (default False)
Don't pipe output. Note that this will cause the returned object's
``stdout`` and ``stderr`` attributes to be emtpy strings.
``expect_error``: (default False)
Don't raise an exception in case of errors
``expect_stderr``: (default ``expect_error``)
Expand Down
7 changes: 6 additions & 1 deletion scripttest.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ def run(self, script, *args, **kw):

Keywords allowed are:

``debug``: (default False)
Don't pipe output. Note that this will cause the returned object's
``stdout`` and ``stderr`` attributes to be emtpy strings.
``expect_error``: (default False)
Don't raise an exception in case of errors
``expect_stderr``: (default ``expect_error``)
Expand Down Expand Up @@ -255,7 +258,9 @@ def run(self, script, *args, **kw):
env=clean_environ(self.environ))

if debug:
stdout, stderr = proc.communicate()
proc.communicate()
stdout = ''
stderr = ''
else:
stdout, stderr = proc.communicate(stdin)
stdout = string(stdout)
Expand Down