Add tee capability to CliRunner.invoke(). #459
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'm a French software developer, working at CEA (http://www.cea.fr/english-portal). For a project using Galaxy (https://galaxyproject.org/), I've been looking at the related project Planemo (http://planemo.readthedocs.org/en/latest/index.html), which uses your library "click". One issue I have is that Planemo tests run a script using your CliRunner class, but this script takes a long time and, since stdout is hidden, no feedback is given to the user until the script terminates and Planemo tests finally print the output.
So I've decided to modify your library in order to be able to print continuously stdout and stderr while running. I've added a parameter called tee inside the invoke method, and I set it to false by default. When set to true, a class called MultOutput will be instantiated instead of StringIO, that will take for parameters the StringIO instance and also stdout (or stderr). Each output will then be printed into StringIO as well as into stdout (or stderr).
Don't hesitate to contact me if you have any question.
Regards,
Pierrick