zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Add type hints to `test_messages.py`

Open neiljp opened this issue 1 year ago • 24 comments

Many of our tests have type hints, primarily on fixtures and the test function parameters, but we have some remaining exclusions, as noted in #1229.

It is worth noting that consistency between elements are not all checked by mypy or pytest right now, so attention to detail will be important.

This could be an ideal first issue for you, but likely only if you have a background in Python Type Hints and pytest.

That said, the parameters to these test functions generally come in one of 4 categories:

  • parameters with default values: that makes determining the type to use more straightforward
  • parameters from a parametrize decorator: check the data in the list of values above the function name
  • our fixtures: these will be in the test file, or in conftest.py; look for the return type
  • other fixtures: this is something like mocker, which is a MockerFixture from pytest_mock

While working, you'll want to disable excluding the file from being checked by mypy by removing that line from pyproject.toml and adding to a separate commit before anything else. Check the commit log for the style used for other typing of test files (mainly by prah23).

It's likely worth working on one test function at a time in a separate commit, which we may squash together before merging. Once the file fully passes mypy cleanly, we can then move the first commit to the end, so that mypy doesn't complain before the file is fixed. That commit will then ensure that changes to that file will require type hints in future.

This is one element of #1229: please focus on this one file of that issue first, and if things go well, then you would be well situated to cover the remaining files later as followup PR(s). If you wish to work on a different file then please discuss in #zulip-terminal first.

neiljp avatar Mar 19 '23 02:03 neiljp

Hello @zulip/server-refactoring members, this issue was labeled with the "area: refactoring" label, so you may want to check it out!

zulipbot avatar Mar 19 '23 02:03 zulipbot

@zulipbot claim

abdulmoiz37 avatar Mar 28 '23 03:03 abdulmoiz37

Welcome to Zulip, @abdulmoiz37! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Mar 28 '23 03:03 zulipbot

@abdulmoiz37 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

zulipbot avatar Apr 07 '23 03:04 zulipbot

@zulipbot I am working on this issue and it will be fixed soon

abdulmoiz37 avatar Apr 07 '23 07:04 abdulmoiz37

ERROR: Unexpected response from GitHub API.

zulipbot avatar May 02 '23 23:05 zulipbot

@zulipbot claim --force

SBNetto01 avatar May 04 '23 19:05 SBNetto01

Welcome to Zulip, @SBNetto01! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar May 04 '23 19:05 zulipbot

@SBNetto01 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

zulipbot avatar May 14 '23 21:05 zulipbot

@zulipbot still working

SBNetto01 avatar May 15 '23 21:05 SBNetto01

@zulipbot claim

SBNetto01 avatar May 21 '23 16:05 SBNetto01

@SBNetto01 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

zulipbot avatar May 31 '23 22:05 zulipbot

ERROR: Unexpected response from GitHub API.

zulipbot avatar Dec 29 '23 22:12 zulipbot

@zulipbot is this issue still active?

gyan313 avatar Dec 30 '23 06:12 gyan313

@Gyan313 This issue is still active. The last work on this was #1407 by @SBNetto01.

neiljp avatar Jan 04 '24 20:01 neiljp

@zulipbot claim

rosefinchh avatar Feb 29 '24 05:02 rosefinchh

Welcome to Zulip, @rosefinchh! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Feb 29 '24 05:02 zulipbot

@zulipbot abandon

rosefinchh avatar Feb 29 '24 06:02 rosefinchh

@zulipbot claim

Aryan51203 avatar Feb 29 '24 18:02 Aryan51203

Welcome to Zulip, @Aryan51203! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Feb 29 '24 18:02 zulipbot

@Aryan51203 We noticed that you have not made any updates to this issue or linked PRs for 10 days. Please comment here if you are still actively working on it. Otherwise, we'd appreciate a quick @zulipbot abandon comment so that someone else can claim this issue and continue from where you left off.

If we don't hear back, you will be automatically unassigned in 4 days. Thanks!

zulipbot avatar Mar 14 '24 19:03 zulipbot

@zulipbot abandon

Aryan51203 avatar Mar 18 '24 05:03 Aryan51203

@zulipbot claim

darksapien23151 avatar Aug 14 '24 18:08 darksapien23151

Welcome to Zulip, @darksapien23151! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Aug 14 '24 18:08 zulipbot