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

PendingDeprecationWarning: generator 'pytest_pycollect_makeitem' raised StopIteration #38

Closed
5j9 opened this issue Dec 22, 2016 · 5 comments

Comments

@5j9
Copy link

5j9 commented Dec 22, 2016

Hi,

I'm getting lots of these warnings when running some of the pywikibot tests using pytest and python 3.5.

WARNING: C:\Users\a\AppData\Local\Programs\Python\Python35\lib\site-packages\_pytest\vendored_packages\pluggy.py:250: PendingDeprecationWarning: generator 'pytest_pycollect_makeitem' raised StopIteration
  wrap_controller.send(call_outcome)

See: https://travis-ci.org/wikimedia/pywikibot-core/jobs/167265098#L493

@goodboy
Copy link
Contributor

goodboy commented Dec 22, 2016

@RonnyPfannschmidt @5j9 this is due to PEP 479 which is in full here.

So it's the underlying hookwrapper which is triggering this warning not pluggy code.

In this case the default implementation of pytest_pycollect_makeitem is raising StopIteration (deprecated in py3.6) instead of using return.

However, in order to support py3.6 we need to change _wrapped_call() to except RuntimeErrors alongside StopIterations.
^ Correction it is only the hookwrapper bodies which should change.
A RuntimeError would indicate a raised StopIteration which we should not expect.

@RonnyPfannschmidt I believe and issue with pytest should be made?

@RonnyPfannschmidt
Copy link
Member

Correct, thanks for investigation

@goodboy
Copy link
Contributor

goodboy commented Feb 8, 2017

@RonnyPfannschmidt pretty sure this can be closed now?

@nicoddemus
Copy link
Member

Yep, thanks for the ping!

@nicoddemus
Copy link
Member

Fixed in pytest-dev/pytest#2226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants