Skip to content

gh-151693: Add curses tests for panels, textpad, and window behavior#151694

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:test-curses
Jun 19, 2026
Merged

gh-151693: Add curses tests for panels, textpad, and window behavior#151694
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:test-curses

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 19, 2026

Copy link
Copy Markdown
Member

Extend test_curses with behaviour-verifying tests that go beyond the existing smoke tests:

  • curses.panel stacking: new_panel/top/bottom/above/below ordering, hide/show/hidden, move, replace, window, userptr and update_panels.
  • Real-window curses.textpad.Textbox: gather(), edit(), stripspaces, insert mode and the editing commands (previously only exercised through a MagicMock), plus textpad.rectangle().
  • Window output/input: addstr/addnstr cursor and truncation, insstr/insnstr/insch shifting, and pad behaviour, verified by reading the cells back.
  • Error handling: out-of-range coordinates and bad argument types.
  • Previously untested entry points: curses.wrapper(), window.insch(), curses.panel.update_panels() and curses.has_key().

The new tests pass across the terminfo database; the only test_curses failures are pre-existing ones on hardcopy / printer / teletype / sub-window-sized devices that cannot support full-screen curses.

🤖 Generated with Claude Code

Extend test_curses with behavior-verifying tests that go beyond the
existing smoke tests:

* curses.panel stacking: new_panel/top/bottom/above/below ordering,
  hide/show/hidden, move, replace and userptr round-trip.
* Real-window curses.textpad.Textbox: gather(), edit(), stripspaces,
  insert mode and the Emacs-like editing commands (previously only
  exercised through a MagicMock).
* Window output: addstr cursor advance and addnstr truncation,
  insstr/insnstr shifting without cursor movement, and pad behavior
  (instr, subpad cell sharing, the required 6-argument refresh()).
* Error handling: out-of-range coordinates raising curses.error and
  bad character/string argument types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting core review labels Jun 19, 2026
@serhiy-storchaka serhiy-storchaka added skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 19, 2026
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 19, 2026 09:34
@serhiy-storchaka serhiy-storchaka merged commit b4cfb99 into python:main Jun 19, 2026
136 of 142 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151719 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 19, 2026
@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151720 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 19, 2026
@serhiy-storchaka serhiy-storchaka deleted the test-curses branch June 19, 2026 09:36
@bedevere-app

bedevere-app Bot commented Jun 19, 2026

Copy link
Copy Markdown

GH-151721 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 19, 2026
serhiy-storchaka added a commit that referenced this pull request Jun 19, 2026
…havior (GH-151694) (GH-151720)

Add curses tests for panels, textpad, and window behavior

Extend test_curses with behavior-verifying tests that go beyond the
existing smoke tests:

* curses.panel stacking: new_panel/top/bottom/above/below ordering,
  hide/show/hidden, move, replace and userptr round-trip.
* Real-window curses.textpad.Textbox: gather(), edit(), stripspaces,
  insert mode and the Emacs-like editing commands (previously only
  exercised through a MagicMock).
* Window output: addstr cursor advance and addnstr truncation,
  insstr/insnstr shifting without cursor movement, and pad behavior
  (instr, subpad cell sharing, the required 6-argument refresh()).
* Error handling: out-of-range coordinates raising curses.error and
  bad character/string argument types.
(cherry picked from commit b4cfb99)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jun 19, 2026
…havior (GH-151694) (GH-151721)

Add curses tests for panels, textpad, and window behavior

Extend test_curses with behavior-verifying tests that go beyond the
existing smoke tests:

* curses.panel stacking: new_panel/top/bottom/above/below ordering,
  hide/show/hidden, move, replace and userptr round-trip.
* Real-window curses.textpad.Textbox: gather(), edit(), stripspaces,
  insert mode and the Emacs-like editing commands (previously only
  exercised through a MagicMock).
* Window output: addstr cursor advance and addnstr truncation,
  insstr/insnstr shifting without cursor movement, and pad behavior
  (instr, subpad cell sharing, the required 6-argument refresh()).
* Error handling: out-of-range coordinates raising curses.error and
  bad character/string argument types.
(cherry picked from commit b4cfb99)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant