-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix type annotation of lib/tool_shed/test/functional/
#16901
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks so much. I've been trying to look at the failing tests today and not making much progress. Here's hoping that mypy will give some good indications of the null pointer issues - very nice. |
nsoranzo
force-pushed
the
ts_type_annot
branch
from
October 23, 2023 21:27
126df89
to
eff0ff4
Compare
to not exclude the `lib/tool_shed/test/functional/` directory.
nsoranzo
force-pushed
the
ts_type_annot
branch
from
October 24, 2023 11:15
eff0ff4
to
37a5aa2
Compare
…nd_owner()` return a `Repository`
Fix the following mypy error: ``` lib/tool_shed/test/functional/test_0000_basic_repository_features.py:303: error: Item "None" of "ToolShedPopulator | None" has no attribute "get_metadata" [union-attr] metadata = self._populator.get_metadata(repository, downloadable_only=False) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
Fix the following mypy error: ``` lib/tool_shed/test/functional/test_shed_tools.py:63: error: Argument 1 to "tool_guid" of "ToolShedPopulator" has incompatible type "TestShedToolsApi"; expected "HostsTestToolShed" [arg-type] tool_id = populator.tool_guid(self, repository, "Add_a_column1... ^ lib/tool_shed/test/functional/test_shed_tools.py:63: note: Following member(s) of "TestShedToolsApi" have conflicts: lib/tool_shed/test/functional/test_shed_tools.py:63: note: port: expected "int", got "Optional[str]" ```
Fix the following mypy errors: ``` lib/tool_shed/test/functional/test_1140_simple_repository_dependency_multiple_owners.py:108: error: Unexpected keyword argument "filepath" for "commit_tar_to_repository" of "ShedTwillTestCase" [call-arg] self.commit_tar_to_repository( ^ lib/tool_shed/test/base/twilltestcase.py:1156: note: "commit_tar_to_repository" of "ShedTwillTestCase" defined here lib/tool_shed/test/functional/test_1140_simple_repository_dependency_multiple_owners.py:108: error: Unexpected keyword argument "valid_tools_only" for "commit_tar_to_repository" of "ShedTwillTestCase" [call-arg] self.commit_tar_to_repository( ^ lib/tool_shed/test/functional/test_1140_simple_repository_dependency_multiple_owners.py:108: error: Unexpected keyword argument "uncompress_file" for "commit_tar_to_repository" of "ShedTwillTestCase" [call-arg] self.commit_tar_to_repository( ^ lib/tool_shed/test/functional/test_1140_simple_repository_dependency_multiple_owners.py:108: error: Unexpected keyword argument "remove_repo_files_not_in_tar" for "commit_tar_to_repository" of "ShedTwillTestCase" [call-arg] self.commit_tar_to_repository( ^ lib/tool_shed/test/functional/test_1140_simple_repository_dependency_multiple_owners.py:108: error: Unexpected keyword argument "strings_not_displayed" for "commit_tar_to_repository" of "ShedTwillTestCase"; did you mean "strings_displayed"? [call-arg] self.commit_tar_to_repository( ^ lib/tool_shed/test/functional/test_0420_citable_urls_for_repositories.py:170: error: Need type annotation for "strings_not_displayed_in_iframe" (hint: "strings_not_displayed_in_iframe: List[<type>] = ...") [var-annotated] strings_not_displayed_in_iframe = [] ^ ```
Fix: ``` lib/tool_shed/test/functional/test_shed_tools.py:30: error: Incompatible types in assignment (expression has type "BuildSearchIndexResponse", variable has type "ToolSearchResults") [assignment] response = populator.reindex() ^ lib/tool_shed/test/functional/test_shed_tools.py:31: error: Incompatible types in assignment (expression has type "BuildSearchIndexResponse", variable has type "ToolSearchResults") [assignment] response = populator.reindex() ^ ```
Fix the following mypy error: ``` lib/tool_shed/test/functional/test_frontend_login.py:76: error: Argument "redirect" to "login" of "ShedTwillTestCase" has incompatible type "None"; expected "str" [arg-type] self.login(email, TEST_PASSWORD, username=user, redirect=None) ^ ```
nsoranzo
force-pushed
the
ts_type_annot
branch
from
October 24, 2023 12:10
37a5aa2
to
256a81f
Compare
This is ready for review. |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enable checking of this directory in mypy configuration.
How to test the changes?
(Select all options that apply)
License