-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Provide dedicated control over truncation of "short test summary info" lines #10264
Comments
Perhaps it makes sense for us to detect we are running on CI and not truncate at all? I recall we already do something similar to truncate tracebacks... |
not sure if worth "on CI" -- the same effect is observed when stdout is not a terminal, i.e. if gets piped to |
Fair enough. |
Can you provide a reproducible example? I'd like to take a stab at this :) |
#!/bin/bash
set -x
cd "$(mktemp -d ${TMPDIR:-/tmp}/pytest-XXXXXXX)"
cat >| test_some_path_could_be_long.py <<EOF
def test_short_fail():
assert False
def test_veryyyyyyyyy_long_test_name_just_because_no_long_path():
assert False # which could be long line too
EOF
python3 -m pytest test_some_path_could_be_long.py
python3 -m pytest test_some_path_could_be_long.py | cat
would end with
so no the |
ping on this |
Could we have a flag that just stops the truncation of the summary? I would personally just use that in general, even outside of CI. |
What's the problem this feature will solve?
Currently we cannot easily grasp the summary of underlying fails/errors which happened on CIs (logs archived using https://github.com/con/tinuous/) because "short test summary info" truncates to the width of the terminal which is in non-interactive session happens to be around 80. So we get just e.g.
The only workaround I found is to specify explicitly COLUMNS env var to be of some higher value on CI, but that would make the entire log wider, so wider section headers etc.
Ideally I wish there was some pytest setting which would take and not truncate the first line (i.e. split by
\n
) of that line to be displayed so in the captured logs we have it in its entirety.The text was updated successfully, but these errors were encountered: