#4597: tee-stdio capture method#6315
Conversation
nicoddemus
left a comment
There was a problem hiding this comment.
Overall excellent patch, really solid (good docs, tests, everything).
I've left a few suggestions inline.
|
Added the requested test and got all checks passing :) |
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
great work, upon rereading the full pr with docs and all, i realize that tee-sys might be a better name as it leaves open the creation of a symmetric tee-fd if we ever figure a reasonable implementation for that
|
Yeah, this should definitely be But I think it makes more sense as a separate option that gets handled by (In #4597 it was mentioned to be more tricky for fds, but it is done here by just writing to the orig handler anyway (which likely also works for the fd method then).) |
|
Alrighty swapped name to tee-sys |
|
@blueyed fd-tee has to have a completely different solution, as it has to work for non python and subprocesses |
|
My thought/idea was that MultiCapture would just call through to |
|
@blueyed that only works for python level file objects (its not enough for a fd) |
|
Thanks again @csm10495! I've added a link to the docs in the changelog entry and rebased/squashed the commits. 👍 We should merge once CI passes. |
|
Thanks! This is a really useful feature. |
Thanks for submitting a PR, your contribution is really appreciated!
Here is a quick checklist that should be present in PRs.
Target the
featuresbranch for new features, improvements, and removals/deprecations.Include documentation when adding new features.
Include new tests or update existing tests when applicable.
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
Create a new changelog file in the
changelogfolder, with a name like<ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.Add tee-stdio capture mechanism to allow both live printing and capturing of test output.
AUTHORSin alphabetical order.