Skip to content

Type hint: Add hints to TestMessageBox in ui_tools/test_messages.py#1613

Open
kushalnsetty wants to merge 2 commits intozulip:mainfrom
kushalnsetty:type-hint
Open

Type hint: Add hints to TestMessageBox in ui_tools/test_messages.py#1613
kushalnsetty wants to merge 2 commits intozulip:mainfrom
kushalnsetty:type-hint

Conversation

@kushalnsetty
Copy link
Copy Markdown
Collaborator

What does this PR do, and why?

This PR adds comprehensive type hints to the TestMessageBox class and its associated helper functions within zulipterminal/ui_tools/test_messages.py.

As part of the effort to improve the project's type safety, this change:

  • Provides explicit types for parameters in various @pytest.mark.parametrize decorators.
  • Type-hints fixtures such as mocker, message_fixture, and widget_size.
  • Enables mypy for this file by removing the corresponding exclusion from pyproject.toml.

External discussion & connections

How did you test this?

  • Existing automated tests should already cover this (only a refactor of tested code)
  • Verified type-checking by running mypy zulipterminal/ui_tools/messages.py.
  • Verified test integrity by running pytest zulipterminal/ui_tools/messages.py.

Self-review checklist for each commit

  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Feb 6, 2026
@kushalnsetty
Copy link
Copy Markdown
Collaborator Author

I've rebased the branch to include the issue reference #1337 in the commit messages as requested. Thanks for the guidance!

@kushalnsetty
Copy link
Copy Markdown
Collaborator Author

@neiljp i have opened this PR for #1337 please Review and let me know of any issues.
Thank you

@Niloth-p
Copy link
Copy Markdown
Collaborator

Niloth-p commented Feb 9, 2026

Please fix the failing tests.

@kushalnsetty
Copy link
Copy Markdown
Collaborator Author

@Niloth-p thankyou for your insights
8 out of 11 tests are passed and i dont know why the remaining tests are failing and how to fix it can you please guide me through it

and my apology for replying so lately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XL [Automatic label added by zulipbot]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add type hints to test_messages.py

3 participants