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

Add colour to unittest output #127221

Open
hugovk opened this issue Nov 24, 2024 · 2 comments
Open

Add colour to unittest output #127221

hugovk opened this issue Nov 24, 2024 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@hugovk
Copy link
Member

hugovk commented Nov 24, 2024

Feature or enhancement

In Python 3.13, we added colour output to the new REPL, tracebacks and doctest, that can also be controlled with the PYTHON_COLORS, NO_COLOR and FORCE_COLOR environment variables:

Let's add colour to unittest output.

Linked PRs

@hugovk hugovk added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Nov 24, 2024
@hugovk hugovk self-assigned this Nov 24, 2024
@terryjreedy
Copy link
Member

Please see #127060. For the new REPL, ANSI sequences are added to the output stream only on non-Windows systems. A GUI-based program like IDLE could learn to intercept the codes and converted to GUI-specific manipulations of the text widget. But on Windows, the console is manipulated directly, and GUI-based programs are left in the dust. I think there should first be a option to get output streams consistent across systems, with or without color codes, before extending this behavior to more output.

@hugovk
Copy link
Member Author

hugovk commented Dec 3, 2024

@terryjreedy I don't quite follow, are you saying that there's no colour support for GUIs such as IDLE on Windows, and that we shouldn't add more colour handling until we can add colour for IDLE on Windows?

If so, I don't think adding colour to unittest needs to wait, as running unittest from IDLE seems somewhat of an edge case.

also, I'm not sure about the connection to #127060, that's a Linux-only bug (and when using a custom sys.excepthook).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants