Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Improve verbose output by wrapping skip/xfail reasons with margin #10958
Improve verbose output by wrapping skip/xfail reasons with margin #10958
Changes from 3 commits
64ed241
c516d6c
dbcfdf1
04c6f93
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure "wrap" is appropriated, given "wrap" in this contents is to preserve the text, but wrapping it around at certain width (for example 70). I think what we are doing here is actually truncating, so perhaps
truncate_write
or something would be more appropriate?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to rename to whatever, but in this case, the new method is only wrapping text. The truncated output you saw was unmodified behavior due to the test testing multiple outputs.
I'm not particularly satisfied with the name because I'm not sure that it feels sufficiently conventional. Perhaps
write_wrapped_text
or something similar would be better?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I misunderstood the output hence my misguided suggestion.
wrap_write
is fine, thanks! 👍Check warning on line 441 in src/_pytest/terminal.py
Codecov / codecov/patch
src/_pytest/terminal.py#L440-L441
Check warning on line 450 in src/_pytest/terminal.py
Codecov / codecov/patch
src/_pytest/terminal.py#L449-L450
Check warning on line 598 in src/_pytest/terminal.py
Codecov / codecov/patch
src/_pytest/terminal.py#L598
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicoddemus,
Thanks for taking a look.
The test
test_verbose_skip_reason
runs pytest twice, once with-v
, and once with-vv
. The output you provided was from the first run, which is less verbose, hence the truncation. I modified the expected output for the second run to expect the output to continue onto a new line in the middle of the output. This comment annotates that modification to help show more clearly that the modified test does check for the changed behavior.Hopefully that makes sense, but let me know if it needs further clarification or changes to make it more clear. For example, we could break the runs into two separate tests, and move the common inputs and outputs into a fixture rather than the test body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh right, sorry I missed that, thanks for the explanation. 👍