[New-bugs-announce] [issue47065] test_curses fails if terminal defaults to bright white text (15)

Nick Coghlan report at bugs.python.org
Sat Mar 19 07:10:26 EDT 2022

New submission from Nick Coghlan <ncoghlan at gmail.com>:

test_curses fails for me by default (running on Fedora 35 in KDE's Konsole):

[ncoghlan at thechalk cpython]$ echo $TERM
[ncoghlan at thechalk cpython]$ ./python -m test -u curses test_curses
0:00:00 load avg: 0.88 Run tests sequentially
0:00:00 load avg: 0.88 [1/1] test_curses
test test_curses failed -- Traceback (most recent call last):
  File "/home/ncoghlan/devel/cpython/Lib/test/test_curses.py", line 48, in wrapped
    test(self, *args, **kwargs)
  File "/home/ncoghlan/devel/cpython/Lib/test/test_curses.py", line 993, in test_use_default_colors
    self.assertIn(old, [(curses.COLOR_WHITE, curses.COLOR_BLACK), (-1, -1), (0, 0)])
AssertionError: (15, 0) not found in [(7, 0), (-1, -1), (0, 0)]

test_curses failed (1 failure)

== Tests result: FAILURE ==

1 test failed:

Total duration: 466 ms
Tests result: FAILURE

The active terminal info indicates that the default text colour is indeed bright white (assuming I'm reading the infocmp output correctly), so it feels like (15, 0) is just missing from the set of permissible "old" colour pairs in the test case:

[ncoghlan at thechalk cpython]$ infocmp -L | grep initialize_color

components: Tests
messages: 415539
nosy: ncoghlan, petr.viktorin, twouters
priority: normal
severity: normal
stage: needs patch
status: open
title: test_curses fails if terminal defaults to bright white text (15)
type: behavior

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list