📝 Add information about terminal width for testing output#1521
📝 Add information about terminal width for testing output#1521mbergen wants to merge 3 commits intofastapi:masterfrom
Conversation
Add instructions for checking rich output and setting terminal width in testing.
📝 Docs previewLast commit 525b08e at: https://aac083df.typertiangolo.pages.dev Modified Pages |
svlandeg
left a comment
There was a problem hiding this comment.
I think users who read this might be a bit confused about COLUMNS vs. TERMINAL_WIDTH, when to use one and when the other.
docs/tutorial/testing.md
Outdated
|
|
||
| /// tip | ||
|
|
||
| It is necessary to set these variables *before* importing a Typer app for testing. |
There was a problem hiding this comment.
There's a difference between the two though, TERMINAL_WIDTH needs to be defined even before importing typer. COLUMNS can be set at runtime. Perhaps it would make sense to provide an example in the line of #1542.
There was a problem hiding this comment.
I've clarified the tip to mention only TERMINAL_WIDTH.
I'm a bit confused about the PR you've linked; in my tests (and thats what started the discussion as well as this PR), COLUMNS has no effect on the output of a typer app with --help.
I'll test a bit more and add an example if i can reproduce the behavior of the linked PR
Followup for #1520:
Add a section about setting the terminal width for testing purposes using environment variables as read by Typer and Rich.