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

Adds ability to configure stderr output color #3426

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Oct 28, 2024

This feature will allow users to control the coloring of stderr with tox, including ability to avoiding adding colors to it, while still using colors as many tools are already producing colored output.

Please, make sure you address all the checklists (for details on how see
development documentation)! -->

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@ssbarnea ssbarnea marked this pull request as ready for review November 19, 2024 13:46
@ssbarnea ssbarnea enabled auto-merge (squash) November 19, 2024 13:46
@ssbarnea
Copy link
Member Author

@gaborbernat Can you have another look please? Thanks.

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

The build is failing so there's nothing to review yet that much

@@ -77,7 +87,7 @@ def test_local_execute_basic_pass( # noqa: PLR0913
out_got, err_got = out_err.read_out_err()
if show:
assert out_got == out
expected = (f"{Fore.RED}{err}{Fore.RESET}" if color else err) if err else ""
expected = f"{Fore.__dict__[stderr_color]}{err}{Fore.RESET}" if color and err else err
Copy link
Member

Choose a reason for hiding this comment

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

Use getattr instead of this dictionary lookup.

@gaborbernat gaborbernat marked this pull request as draft November 26, 2024 02:09
auto-merge was automatically disabled November 26, 2024 02:09

Pull request was converted to draft

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

Successfully merging this pull request may close these issues.

2 participants