Skip to content
Snippets Groups Projects
Commit 6e89eab3 authored by Michiel Cottaar's avatar Michiel Cottaar Committed by Paul McCarthy
Browse files

Remove unused `real_stdout` attribute

The reason for removing this is that pytest sets the `sys.stdout` to some object which cannot be pickled. So, any `test_run.test_wrapper_to_cmd` fails within pytest, even though there is no such problem outside of pytest.
parent 1d3f1741
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ DRY_RUN = False
execute them.
"""
DRY_RUN_COMMANDS = []
DRY_RUN_COMMANDS = None
"""Contains the commands that got logged during a dry run.
Commands will be logged if :data:`DRY_RUN` is true, which can be set using :func:`dryrun`.
......@@ -112,7 +112,6 @@ def prepareArgs(args):
return list(args)
real_stdout = sys.stdout
def _forwardStream(in_, *outs):
"""Creates and starts a daemon thread which forwards the given input stream
to one or more output streams. Used by the :func:`run` function to redirect
......@@ -275,7 +274,8 @@ def _dryrun(submit, returnStdout, returnStderr, returnExitcode, *args):
# Save command/submit parameters -
# see the dryrun ctx manager
DRY_RUN_COMMANDS.append((args, submit))
if DRY_RUN_COMMANDS is not None:
DRY_RUN_COMMANDS.append((args, submit))
if submit:
return ('0',)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment