Skip to content

#4597: tee-stdio capture method #6315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2019
Merged

Conversation

csm10495
Copy link
Member

@csm10495 csm10495 commented Dec 4, 2019

  • Thanks for submitting a PR, your contribution is really appreciated!

  • Here is a quick checklist that should be present in PRs.

  • Target the features branch 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 changelog folder, 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.

  • Add yourself to AUTHORS in alphabetical order.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall excellent patch, really solid (good docs, tests, everything).

I've left a few suggestions inline.

@csm10495
Copy link
Member Author

csm10495 commented Dec 5, 2019

Added the requested test and got all checks passing :)

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@blueyed
Copy link
Contributor

blueyed commented Dec 5, 2019

Yeah, this should definitely be tee-sys (if it stays this way).

But I think it makes more sense as a separate option that gets handled by MultiCapture then, i.e. the wrapper of FDCapture/SysCapture. Then it would work for both methods.

(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).)

@csm10495
Copy link
Member Author

csm10495 commented Dec 5, 2019

Alrighty swapped name to tee-sys

@RonnyPfannschmidt
Copy link
Member

@blueyed fd-tee has to have a completely different solution, as it has to work for non python and subprocesses

@blueyed
Copy link
Contributor

blueyed commented Dec 5, 2019

My thought/idea was that MultiCapture would just call through to write_orig (or whatever it is called), but have not really checked the code etc.

@RonnyPfannschmidt
Copy link
Member

@blueyed that only works for python level file objects (its not enough for a fd)

@nicoddemus
Copy link
Member

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.

@ssbarnea
Copy link
Member

Thanks! This is a really useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants