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

Fix ANSI escape codes for colored output not handled correctly with pytest.fail(..., pytrace=False) #12959

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

leonarduschen
Copy link

@leonarduschen leonarduschen commented Nov 13, 2024

Closes #12849


Description:


  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.
  • Add text like closes #XYZW to the PR description and/or commits (where XYZW is the issue number). See the github docs for more information.
  • Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.
  • Add yourself to AUTHORS in alphabetical order.

@leonarduschen leonarduschen marked this pull request as draft November 13, 2024 17:34
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 14, 2024
@leonarduschen leonarduschen changed the title Fix ExcInfo.value printed as source code Fix ANSI escape codes for colored output not handled correctly with pytest.fail(..., pytrace=False) Nov 14, 2024
@leonarduschen leonarduschen marked this pull request as ready for review November 14, 2024 16:32
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.

LGTM, thanks for the PR, appreciate it!

src/_pytest/_code/code.py Show resolved Hide resolved
testing/conftest.py Show resolved Hide resolved
@nicoddemus nicoddemus added the backport 8.3.x apply to PRs at any point; backports the changes to the 8.3.x branch label Nov 21, 2024
@nicoddemus
Copy link
Member

Thanks @leonarduschen!

Will squash/merge in a few days to give others a chance to review it. 👍

@leonarduschen
Copy link
Author

Sure thing @nicoddemus, thanks for the review! Excited for my first contribution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 8.3.x apply to PRs at any point; backports the changes to the 8.3.x branch bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ANSI escape codes for colored output not handled correctly with pytest.fail(reason=..., pytrace=False)
2 participants