Skip to content
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

Testing Documentation w/ stderr #385

Open
7 tasks done
euan-cowie opened this issue Apr 17, 2022 · 2 comments
Open
7 tasks done

Testing Documentation w/ stderr #385

euan-cowie opened this issue Apr 17, 2022 · 2 comments
Labels
question Question or problem

Comments

@euan-cowie
Copy link

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Typer documentation, with the integrated search.
  • I already searched in Google "How to X in Typer" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to Typer but to Click.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

runner = CliRunner(mix_stderr=False) # mix_stderr must to be set to False to access result.stderr

Description

In the Testing documentation there is a Tip 🔥 Box with the following Tip:

You could also check result.stderr for "standard error".

This is true, but only if one sets the extra arguments on the CliRunner - specifically runner = CliRunner(mix_stderr=False). I believe this should be made clear in the documentation, or otherwise the CliRunner can prevent the default mixing of stderr and stdout as provided by click.

Operating System

macOS

Operating System Details

No response

Typer Version

0.4.1

Python Version

3.9.9

Additional Context

No response

@euan-cowie euan-cowie added the question Question or problem label Apr 17, 2022
@royalroot
Copy link

royalroot commented Jun 28, 2022

@euan-cowie:
Thank you for pointing me to mix_stderr=False because I ran in a similar situation ValueError: stderr not separately captured...

@mrchrisadams
Copy link

For those curious, I've created a PR to merge this change in now, as it bit me last week, and I found this issue when searching for a solution.

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

No branches or pull requests

3 participants