diff --git a/docs/index.rst b/docs/index.rst index b82a8be..6a59559 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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``) diff --git a/scripttest.py b/scripttest.py index d00247e..a2592d8 100644 --- a/scripttest.py +++ b/scripttest.py @@ -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``) @@ -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)