pytest-dev / pluggy

A minimalist production ready plugin system
https://pluggy.readthedocs.io/en/latest/
MIT License
1.24k stars 121 forks source link

Make new-style wrappers use explicit `wrapper=True` #411

Closed bluetech closed 1 year ago

bluetech commented 1 year ago

Previously new-style wrappers were implied by the function being a generator, however that broke a use case of a non-wrapper impl being a generator as a way to return an Iterator result. This is legitimate, and used at least by conda (see #403).

Therefore, change to require an explicit wrapper=True. Also adds a test for the iterator-returning case.

Fix #405.