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

Fix two new pylint warnings #1762

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

MVrachev
Copy link
Collaborator

Description of the changes being introduced by the pull request:

New pylint warnings appeared related to changes
in urlib3:

  • tests/test_fetcher_ng.py:128: error: Argument 1 to "ReadTimeoutError"
    has incompatible type "None"; expected "ConnectionPool" [arg-type]
  • tests/test_fetcher_ng.py:128: error: Argument 2 to "ReadTimeoutError"
    has incompatible type "None"; expected "str" [arg-type]

I noticed these errors in this CI run:
https://github.com/theupdateframework/python-tuf/runs/4764931441?check_suite_focus=true

I fixed them by creating a urllib3.HTTPConnectionPool() instance as
the first argument and replaced the second argument with an empty
string.
This seems to do the job.

Signed-off-by: Martin Vrachev [email protected]

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

New pylint warnings appeared related to changes
in urlib3:
- tests/test_fetcher_ng.py:128: error: Argument 1 to "ReadTimeoutError"
has incompatible type "None"; expected "ConnectionPool"  [arg-type]
- tests/test_fetcher_ng.py:128: error: Argument 2 to "ReadTimeoutError"
has incompatible type "None"; expected "str"  [arg-type]
I noticed these error in this CI run:
https://github.com/theupdateframework/python-tuf/runs/4764931441?check_suite_focus=true

I fixed them by creating a urllib3.HTTPConnectionPool() instance as
the first argument and replaced the second argument with an empty
string.
This seems to do the job.

Signed-off-by: Martin Vrachev <[email protected]>
@coveralls
Copy link

coveralls commented Jan 10, 2022

Pull Request Test Coverage Report for Build 1678751200

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.728%

Totals Coverage Status
Change from base Build 1667861141: 0.0%
Covered Lines: 3931
Relevant Lines: 3952

💛 - Coveralls

Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

For completeness: this was a mypy failure, presumably because urllib3 type annotations were improved.

@jku jku merged commit 61ffc9f into theupdateframework:develop Jan 11, 2022
@MVrachev MVrachev deleted the fix-pylint-warning branch January 12, 2022 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants