Skip to content

gh-151776: Fix test_state_getters on terminals without insert/delete capability#152304

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-state-getters-buildbot
Jun 26, 2026
Merged

gh-151776: Fix test_state_getters on terminals without insert/delete capability#152304
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-state-getters-buildbot

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

idcok() and idlok() only take effect when the terminal can insert or delete characters or lines (ncurses sets the window flag to flag && has_ic() and flag && (has_il() || change_scroll_region) respectively). On terminals without those capabilities, is_idcok()/is_idlok() return False even after setting the flag to True, so test_state_getters failed on many buildbots.

Drop these two from the unconditional round-trip loop and assert their getters against the terminal's actual capabilities instead.

…elete capability

idcok() and idlok() take effect only when the terminal can insert or
delete characters or lines, so check their getters against the
terminal's capabilities instead of asserting an unconditional round-trip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 26, 2026
@serhiy-storchaka serhiy-storchaka added skip news and removed tests Tests in the Lib/test dir labels Jun 26, 2026
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 26, 2026 15:27
@serhiy-storchaka serhiy-storchaka merged commit bf61794 into python:main Jun 26, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant