Skip to content

Type improvements#201

Merged
nicoddemus merged 1 commit intopytest-dev:masterfrom
srittau:type-improvements
Aug 26, 2020
Merged

Type improvements#201
nicoddemus merged 1 commit intopytest-dev:masterfrom
srittau:type-improvements

Conversation

@srittau
Copy link
Copy Markdown
Contributor

@srittau srittau commented Aug 24, 2020

  • Annotate MockerFixture.patch(). Without an explicit annotations, mypy and other type checkers can't determine the proper type and assume Any.
  • MockerFixture.patch() can return an arbitrary type if either new or new_callable is provided. Add overloads to handle these cases.

Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks a lot @srittau, indeed I missed those.

Annotate MockerFixture.patch(). Without an explicit annotations, mypy
and other type checkers can't determine the proper type and assume Any.

MockerFixture.patch() can return an arbitrary type if either new or
new_callable is provided. Add overloads to handle these cases.
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