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 — Many tests fail if `FORCE_COLOR` environment variable is set · Issue #117605 · python/cpython

Many tests fail if FORCE_COLOR environment variable is set #117605

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Many tests fail if FORCE_COLOR environment variable is set#117605
Copy link
Labels
3.13only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@AlexWaygood
AlexWaygood
opened on Apr 7, 2024
Issue body actions

Bug report

Bug description:

If you run FORCE_COLOR=1 make test, many tests fail. The failing tests are mostly due to tests which assert the contents of a traceback not expecting traceback to be colorised, but if you pass FORCE_COLOR=1, it seems like Python obediently colorises all traceback.

The full list of failing tests on my machine is:

20 tests failed:
    test.test_inspect.test_inspect test_capi test_cmd_line
    test_cmd_line_script test_compileall test_doctest test_eof
    test_exceptions test_idle test_interpreters test_regrtest
    test_repl test_runpy test_signal test_sys test_threading
    test_traceback test_tracemalloc test_unicodedata test_warnings

test_signal and test_ssl seem to fail on my machine without FORCE_COLOR being set, however, so those are probably unrelated.

Attached is the full output from running ./python.exe -E -m test_traceback -v (which is too long to paste into this issue body directly).

test_traceback.txt

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Activity

  1. AlexWaygood
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    3.13only security fixesonly security fixes
    on Apr 7, 2024
  2. AlexWaygood commented on Apr 7, 2024

    @AlexWaygood
    AlexWaygood
    on Apr 7, 2024
    MemberAuthor
    More actions

    (cc. @pablogsal for colorised tracebacks)

  3. gpshead commented on Apr 7, 2024

    @gpshead
    gpshead
    on Apr 7, 2024
    Member
    More actions

    python -E is defined as only ignoring PYTHON* environment variables. This is a good thing. https://docs.python.org/3/using/cmdline.html#cmdoption-E

    I believe tests either need to be happy in the presence of arbitrary color control codes (barfing rainbows...), or our make test aka python -m test aka regrtest runner should explicitly un-configure the community standard not language specific COLOR variables.

  4. gpshead commented on Apr 7, 2024

    @gpshead
    gpshead
    on Apr 7, 2024
    Member
    More actions

    everyone else seems to be discussing on the other issue #112730, so i suggest others do the same.

    Reacted by Alex Waygood and Pablo Galindo Salgado
  5. AlexWaygood commented on Apr 10, 2024

    @AlexWaygood
    AlexWaygood
    on Apr 10, 2024
    MemberAuthor
    More actions

    PRs to fix this issue have also been linked to #112730, so I'll just close this as a duplicate 👍

    (But I insist on claiming credit for raising the issue in the first place ;)

    Reacted by Hugo van Kemenade
    Reacted by Hugo van Kemenade and Gregory P. Smith
  6. AlexWaygood
    closed this as not plannedon Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    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.