-
-
Notifications
You must be signed in to change notification settings - Fork 263
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: boxes: Add type annotations. #1102
Conversation
Hello @zulip/server-refactoring members, this pull request was labeled with the "area: refactoring" label, so you may want to check it out! |
e9e3a7b
to
cce1d98
Compare
74150b5
to
b00f4e6
Compare
b00f4e6
to
ce4d74b
Compare
As I mentioned in #1096, I think that is best done before this, to finalize the type annotations here. |
@prah23 I was just going to look at this again, but there may have been boxes merges since, as well as the other tests merge - could you do a quick rebase? |
@neiljp sure, I'll just review the types again once, since you wanted the |
ce4d74b
to
66821ec
Compare
PR updated. |
66821ec
to
f4da11e
Compare
This commit patches the `write_box` fixture's `_set_stream_box_write_style` using `mocker.patch` instead of assigning a `mocker.Mock` to it to maintain type consistency.
This commit removes the `mocker` fixture as a parameter from tests where it isn't used.
This commit adds assert statements within multiple tests to assert that the value of WriteBox's `to_write_box` is None after a `private_box_view` function call, since it initiates `to_write_box` with a ReadlineEdit instance. This is also necessary for supporting mypy, since the attribute type depends on whether it is a private box or not.
This commit adds parameter and return type annotations or hints to the `test_boxes.py` file, that contains tests for it's counterpart `boxes.py` from the `zulipterminal` module, to make mypy checks consistent and improve code readability.
This commit adds `test_boxes.py` to the `type_consistent_testfiles` list to check for type consistency with mypy.
f4da11e
to
cb73646
Compare
@prah23 Thanks for keeping up with this 🎉 |
What does this PR do?
Adds type annotations to
test_boxes.py
and adds the file to the list inrun-mypy
. Also has a prior refactor commit to remove unnecessarymocker
parameters.Tested?
Commit flow
refactor: tests: boxes: Remove mocker as parameter where unnecessary.
This commit removes the
mocker
fixture as a parameter from testswhere it isn't used.
refactor: tests: boxes: Add type annotations.
This commit adds parameter and return type annotations or hints to the
test_boxes.py
file, that contains tests for it's counterpartboxes.py
from thezulipterminal
module, to make mypy checksconsistent and improve code readability.
tools: Include test_boxes.py to be checked by mypy.
This commit adds
test_boxes.py
to thetype_consistent_testfiles
list to check for type consistency with mypy.