Skip to content

Add test coverage for mycli/key_bindings.py#1771

Merged
rolandwalker merged 1 commit intomainfrom
RW/add-keybindings-test-coverage
Apr 2, 2026
Merged

Add test coverage for mycli/key_bindings.py#1771
rolandwalker merged 1 commit intomainfrom
RW/add-keybindings-test-coverage

Conversation

@rolandwalker
Copy link
Copy Markdown
Contributor

Description

Add extensive test coverage for mycli/key_bindings.py.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Codex Review

  1. Low: filter-patching helper is brittle to prompt_toolkit internals
    test_key_bindings.py:154 patches emacs_mode.func.__globals__, completion_is_selected.func.__globals__, and control_is_searchable.func.__globals__. This relies on internal structure (.func and module globals) and can break on upstream refactors without behavior changes in mycli.
    Action: prefer exercising filters through an app/session fixture (or patching via stable public hooks) instead of mutating filter function globals.

  2. Low: missing edge-case coverage for combined key behaviors
    test_key_bindings.py:292 and test_key_bindings.py:362 only test single behavior entries (advance, cancel, etc.). mycli/key_bindings.py supports lists, and mixed configs (for example including toolkit_default plus another behavior) can trigger multi-step paths.
    Action: add parametrized cases for mixed behavior lists and assert the exact precedence/side effects.

No correctness or security bugs were found in the PR’s production code path (this PR only adds tests).
I could not execute the new tests locally because uv is unavailable in this environment (uv: command not found).

@rolandwalker rolandwalker merged commit 1305400 into main Apr 2, 2026
10 checks passed
@rolandwalker rolandwalker deleted the RW/add-keybindings-test-coverage branch April 2, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant