You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_curses regression in 3.16.0a1: test_newterm fails on a real terminal that's not 80x25 #159394
The test seems to be written with the wrong assumption that curses will always evaluate the terminal size to 80x25, which fails when tests are run on a real terminal rather than GHA:
======================================================================
FAIL: test_newterm (test.test_curses.ScreenTests.test_newterm)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/portage/dev-lang/python-3.16.0_alpha1/work/Python-3.16.0a1/Lib/test/test_curses.py", line 3336, in test_newtermself.assertEqual(win.getmaxyx(), (24, 80))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: Tuples differ: (24, 135) != (24, 80)
First differing element 1:
135
80
- (24, 135)
+ (24, 80)
----------------------------------------------------------------------
Ran 189 tests in 4.068s
FAILED (failures=1, skipped=4)
The terminal the tests run in does not matter: newterm() is called on a new pseudo-terminal with zero size, so ncurses takes the size from the LINES and COLUMNS environment variables, and from terminfo (24x80 for xterm) only if they are not set. Your environment probably has COLUMNS=135 exported. With LINES=40 COLUMNS=135, SLKTests.test_init_reserves_a_line fails too.
#159665 sets LINES and COLUMNS in these tests, so that every screen they create is 24x80 whatever the environment and the terminfo entry.
Activity
serhiy-storchaka commentedon Oct 18, 2026
The terminal the tests run in does not matter:
newterm()is called on a new pseudo-terminal with zero size, so ncurses takes the size from theLINESandCOLUMNSenvironment variables, and from terminfo (24x80 forxterm) only if they are not set. Your environment probably hasCOLUMNS=135exported. WithLINES=40 COLUMNS=135,SLKTests.test_init_reserves_a_linefails too.#159665 sets
LINESandCOLUMNSin these tests, so that every screen they create is 24x80 whatever the environment and the terminfo entry.Merge remote-tracking branch 'upstream/main' into pythongh-159394-new…