Skip to content

Writing a capfd-freidnly context manager that *also* captures stdout file descriptor #10705

Answered by hroncok
hroncok asked this question in Q&A
Discussion options

You must be logged in to vote

OK, thanks for the rubber 🦆

I've put this initially to workaround something failing:

# stdout FD is 1 in reality, but might be replaced by pytest's capfd
stdout_fd = sys.stdout.fileno()

But apparently stdout_fd = 1 makes it work as desired 😆

Replies: 1 comment 5 replies

Comment options

hroncok
Feb 3, 2023
Collaborator Author

You must be logged in to vote
5 replies
@hroncok
Comment options

hroncok Feb 3, 2023
Collaborator Author

@RonnyPfannschmidt
Comment options

@hroncok
Comment options

hroncok Feb 3, 2023
Collaborator Author

@RonnyPfannschmidt
Comment options

@hroncok
Comment options

hroncok Feb 5, 2023
Collaborator Author

Answer selected by hroncok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants