Skip to content

More type annotations, fix some typing bugs #7358

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

Merged
merged 6 commits into from
Jun 13, 2020

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