Skip to content

test_curses.test_use_default_colors fails on some platforms #132985

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

Closed
picnixz opened this issue Apr 26, 2025 · 2 comments
Closed

test_curses.test_use_default_colors fails on some platforms #132985

picnixz opened this issue Apr 26, 2025 · 2 comments
Assignees
Labels
extension-modules C modules in the Modules dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@picnixz
Copy link
Member

picnixz commented Apr 26, 2025

Bug report

Bug description:

I'm pretty sure it's either my own configuration (openSUSE 15.5 + custom konsole) or my curses version (6.1) but here it is:

$ ./python -m test test_curses -ucurses
Using random seed: 3209469927
0:00:00 load avg: 2.41 Run 1 test sequentially in a single process
0:00:00 load avg: 2.41 [1/1] test_curses
test test_curses failed -- Traceback (most recent call last):
  File "~/lib/python/cpython/Lib/test/test_curses.py", line 49, in wrapped
    test(self, *args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "~/lib/python/cpython/Lib/test/test_curses.py", line 999, 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)]

0:00:00 load avg: 2.41 [1/1/1] test_curses failed (1 failure)

When I want to test curses, I usually skip over this one.

The cause

The current terminal fg/bg colors given by pair_content(0), which is backed by extended_pair_content(3), depends on the terminal emulator and its supported colors. Thus, its output cannot not be reliably checked.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@picnixz picnixz added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Apr 26, 2025
@picnixz picnixz self-assigned this Apr 26, 2025
@picnixz picnixz added the tests Tests in the Lib/test dir label Apr 26, 2025
@serhiy-storchaka
Copy link
Member

This is a duplicate of #91221.

@picnixz
Copy link
Member Author

picnixz commented Apr 26, 2025

Oh! my bad. I'll close this one then.

@picnixz picnixz closed this as completed Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants