pytest-dev / pluggy

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

Warn when old-style hookwrapper raises during teardown #463

Closed bluetech closed 7 months ago

bluetech commented 8 months ago

Old-style hookwrapper raising during teardown causes subsequent teardowns to be deferred until GC (see #244). We've fixed this in pluggy 1.2 using new-style wrappers or Result.force_exception.

If we detect the situation, let's warn about it. See for example https://github.com/pytest-dev/pytest/issues/11714 where a warning would have helped.