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

Do Not Truncate Crash Messages In Short Test Summary on CI #9933

Merged
merged 6 commits into from May 13, 2022

Conversation

sommersoft
Copy link
Contributor

Fixes #9920

This skips crash message truncation, if a CI environment variable is set and truthy.

Should this be mentioned in the docs, maybe as a note? https://github.com/pytest-dev/pytest/blob/main/doc/en/how-to/output.rst#producing-a-detailed-summary-report

Thanks to blueyed for some hints in #5284.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @sommersoft!

Left a few suggestions, please take a look.

Should this be mentioned in the docs, maybe as a note?

Not sure it is needed, but feel free to write a .. note:: at the end of that section if you like. 👍

testing/test_terminal.py Outdated Show resolved Hide resolved
src/_pytest/terminal.py Outdated Show resolved Hide resolved
changelog/9920.improvement.rst Outdated Show resolved Hide resolved
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks great!

Feel free to add yourself to the AUTHORS file btw.

@sommersoft
Copy link
Contributor Author

Fixed the merge conflicts (hopefully).

Feel free to add yourself to the AUTHORS file btw.

Maybe at some point. This was a tiny change, but I appreciate the sentiment.

@nicoddemus nicoddemus merged commit 56c2666 into pytest-dev:main May 13, 2022
@nicoddemus
Copy link
Member

Thanks again @sommersoft !

@sommersoft sommersoft deleted the 9920-summary-no-truncate-ci branch May 13, 2022 11:37
@stevenmchaves
Copy link

Which version of pytest will this be in?

@The-Compiler
Copy link
Member

Which version of pytest will this be in?

The next feature release, i.e., 7.2.

@jainshilpi
Copy link

Which python version does it need? It seems it can work with 3.9. If I use python version 3.9 and install pytest version 7.2:
python3.9 -m pip install --user pytest==7.2 , it says this version does not exist. What are the requirements to use this pytest version?

@The-Compiler
Copy link
Member

@jainshilpi There has not been a 7.2 release yet, so that's correct - but not related to your Python version. See #10045.

(For the record, the supported Python versions are documented here: Python version support. At the time of writing, 3.7+ is supported.)

@jainshilpi
Copy link

I see, thanks for the pointers. I suppose I'll have to wait till then? Or is there a quick fix to this issue of truncated messages at the end?

@The-Compiler
Copy link
Member

You could maybe set COLUMNS to some high value in your environment, or install pytest from git.

@TurekBot
Copy link

Really appreciate you adding this fix!

I'm new to pytest, but should "CI" and "BUILD_NUMBER" be added to the "Environment Variables" section of the reference?

@nicoddemus
Copy link
Member

I'm new to pytest, but should "CI" and "BUILD_NUMBER" be added to the "Environment Variables" section of the reference?

Good idea, created #10690 to track that. PRs are welcome! 😁

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

Successfully merging this pull request may close these issues.

Do no truncate summary messages on CI
6 participants