GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add colour to unittest output · Issue #127221 · python/cpython

Add colour to unittest output #127221

New issue
Copy link
New issue
Copy link
Closed
Closed
Add colour to unittest output#127221
Copy link
Assignees
hugovk
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@hugovk
hugovk
opened on Nov 24, 2024
Issue body actions

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:

  • https://docs.python.org/3/whatsnew/3.13.html#summary-release-highlights
  • https://docs.python.org/3.13/using/cmdline.html#using-on-controlling-color

Let's add colour to unittest output.

Linked PRs

  • gh-127221: Add colour to unittest output #127223
Reacted by Alex Waygood, Peter Bierma, Kirill Podoprigora and Andrew Svetlov

Activity

  1. hugovk
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Nov 24, 2024
  2. hugovk
    self-assigned this
    on Nov 24, 2024
  3. terryjreedy commented on Nov 24, 2024

    @terryjreedy
    terryjreedy
    on Nov 24, 2024
    Member
    More actions

    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.

  4. hugovk commented on Dec 3, 2024

    @hugovk
    hugovk
    on Dec 3, 2024
    MemberAuthor
    More actions

    @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).

    Reacted by Miro Hrončok
  5. hugovk
    added a commit that references this issue on Dec 5, 2024

    gh-127221: Add colour to unittest output (#127223)

    23f2e8f
  6. hugovk
    closed this as completedon Dec 5, 2024
  7. srinivasreddy
    added a commit that references this issue on Jan 8, 2025

    pythongh-127221: Add colour to unittest output (python#127223)

    7dc6aa0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @hugovk
    hugovk

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.