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: config: Add type annotations. #1099

Merged
merged 8 commits into from
Jul 25, 2021
Merged

Conversation

prah23
Copy link
Member

@prah23 prah23 commented Jul 24, 2021

What does this PR do?
Adds type annotations to the test_keys.py, test_themes.py and test_color.py files. Adds these files to the list in run-mypy.

Tested?

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

Commit flow

  • bugfix: tests: keys: Use lists for keys of key bindings.
    This commits replaces the data structure used for mentioning the keys
    of the various key bindings under test_commands_for_random_tips from
    set to list which is the right structure.

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

  • tools: Include test_keys.py to be checked by mypy.
    This commit adds test_keys.py to the type_consistent_testfiles
    list to check for type consistency with mypy.
    Commits on Jul 25, 2021

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

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

  • refactor: tests: color: Rename variable to avoid conflict with class.
    This commit renames the Color variable of test_color_properties
    to avoid conflict with the Color class, to the name color
    instead.

  • refactor: tests: color: Add type annotations.
    This commit adds paramter and return type annotations or hints to the
    test_color.py file, that contains tests for it's counterpart
    color.py from the zulipterminal module, to make mypy checks
    consistent and improve code readability.

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

@zulipbot zulipbot added the size: L [Automatic label added by zulipbot] label Jul 24, 2021
prah23 added 8 commits July 25, 2021 10:22
This commit replaces the data structure used for mentioning the keys
of the various key bindings under `test_commands_for_random_tips` from
`set` to `list` which is the right structure.
This commit adds parameter and return type annotations or hints
to the `test_keys.py` file, that contains tests for its counterpart
`keys.py` from  the `zulipterminal` module, to make mypy checks
consistent and improve code readability.
This commit adds `test_keys.py` to the `type_consistent_testfiles`
list to check for type consistency with mypy.
This commit adds parameter and return type annotations or hints to the
`test_themes.py` file, that contains tests for its counterpart
`themes.py` from  the `zulipterminal` module, to make mypy
checks consistent and improve code readability.
This commit adds `test_themes.py` to the `type_consistent_testfiles`
list to check for type consistency with mypy.
This commit renames the expanded `Color` Enum of `test_color_properties`
to avoid conflict with the input `Color` Enum, to `ExpandedColor`.
This commit adds parameter and return type annotations or hints to the
`test_color.py` file, that contains tests for it's counterpart
`color.py` from  the `zulipterminal` module, to make mypy checks
consistent and improve code readability.
This commit adds `test_color.py` to the `type_consistent_testfiles`
list to check for type consistency with mypy.
@neiljp neiljp force-pushed the test_annotation_config branch from f58c66e to 3637cb9 Compare July 25, 2021 17:26
@neiljp
Copy link
Collaborator

neiljp commented Jul 25, 2021

@prah23 This was a good choice to group together 👍 zulipbot thinks this is "large", but I'm unconvinced ;) Some of the commits are tiny here again, but I'm OK with this for these changes, for consistency with other similar commits. I've removed a few uses of Any and updated your rename from color -> ExpandedColor (to use CamelCase for the enum), and other than a few minor commit text adjustments this is good to merge and I'll do so shortly 🎉

@neiljp neiljp merged commit 77ebd71 into zulip:main Jul 25, 2021
@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 neiljp added this to the Next Release milestone Jul 25, 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: L [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants