Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: helper: Add type annotations. #1083

Merged
merged 3 commits into from
Jul 15, 2021
Merged

Conversation

prah23
Copy link
Member

@prah23 prah23 commented Jul 15, 2021

What does this PR do?
Adds type annotations to test_helper.py. I've also added a prior bugfix commit changing muted_streams' data structure from List to Set and a final follow up commit to include test_helper.py in the list of files being checked by run-mypy.

Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • Passed linting & tests (each commit)

Commit flow

  • bugfix: tests: helper: Use Sets as params for muted_streams.
    This commits changes the previous incorrect configuration of Lists
    to the muted_streams parameter in test_classify_unread_counts
    which is assigned model's muted_streams, to Sets instead, which is
    the appropriate data structure.

  • refactor: tests: helper: Add type annotations.
    This commit adds parameter and return type annotations or hints
    to the test_helper.py file, that contains tests for its counterpart
    helper.py from the zulipterminal module, to make mypy checks
    consistent and improve code readability.

  • tools: Include test_helper.py to be checked by mypy.
    This commit adds test_helper.py to the type_consistent_testfiles
    list to check for type consistency with mypy.

@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Jul 15, 2021
prah23 added 3 commits July 15, 2021 16:25
This commit changes the previous incorrect configuration of `Lists`
to the `muted_streams` parameter in `test_classify_unread_counts`
which is assigned model's muted_streams, to `Set`s instead, which is
the appropriate data structure.
This commit adds parameter and return type annotations or hints
to the `test_helper.py` file, that contains tests for its counterpart
`helper.py` from  the `zulipterminal` module, to make mypy checks
consistent and improve code readability.
This commit adds `test_helper.py` to the `type_consistent_testfiles`
list to check for type consistency with mypy.
@zulipbot
Copy link
Member

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

@neiljp
Copy link
Collaborator

neiljp commented Jul 15, 2021

@prah23 Looks good after the small Composition tidy I mentioned, so merging now 🎉

@neiljp neiljp merged commit 9cc7004 into zulip:main Jul 15, 2021
@neiljp neiljp added this to the Next Release milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: refactoring area: tests size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants