Skip to content

More type annotations, fix some typing bugs#7358

Merged
bluetech merged 6 commits intopytest-dev:masterfrom
bluetech:typing2
Jun 13, 2020
Merged

More type annotations, fix some typing bugs#7358
bluetech merged 6 commits intopytest-dev:masterfrom
bluetech:typing2

Conversation

@bluetech
Copy link
Member

Please see the commits, but here's a summary:

  • Remove unused type: ignores
  • Add type annotations to MonkeyPatch
  • Add type annotations to pytest_keyboard_interrupt and pytest_internalerror hooks
  • Fix type errors when running with typed py.path.local
  • Fix type errors when running with typed packaging

bluetech added 6 commits June 12, 2020 17:34
Not needed since update from mypy 0.770 -> 0.780.
Also switch to using ExceptionRepr instead of
`Union[ReprExceptionInfo, ExceptionChainRepr]`
which is somewhat annoying and less future proof.
These errors are found using a typed version of py.path.local.
Fixes:

src/_pytest/config/__init__.py:1071: error: Argument 1 to "Version" has incompatible type "Union[str, List[str]]"; expected "str"  [arg-type]
@bluetech
Copy link
Member Author

@symonk The py.path.local fixes should take care of the typing issues you're having in #7350.

@nicoddemus
Copy link
Member

Cool!

@symonk The py.path.local fixes should take care of the typing issues you're having in #7350.

I suppose the idea is for @symonk to rebase his branch once this gets merged, correct?

Copy link
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.

Great, thanks!

@symonk
Copy link
Member

symonk commented Jun 12, 2020

Thanks @nicoddemus / @bluetech Im a bit busy for a day or two and then il revisit my other PR; this is likely merged by then and il bring it in. I need to revisit as to some information Ran has mentioned.

@nicoddemus
Copy link
Member

Thanks @nicoddemus / @bluetech Im a bit busy for a day or two and then il revisit my other PR; this is likely merged by then and il bring it in. I need to revisit as to some information Ran has mentioned.

Sure thing, take your time. 👍

@bluetech bluetech merged commit f551cab into pytest-dev:master Jun 13, 2020
@bluetech bluetech deleted the typing2 branch June 17, 2020 15:00
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