pytest-mpl icon indicating copy to clipboard operation
pytest-mpl copied to clipboard

Upgrade to new-style hook wrappers

Open ConorMacBride opened this issue 1 year ago • 3 comments

Pytest 8 will use the new-style hook wrappers so we should add a version check to update the decorator for our pytest_runtest_call hooks.

See also: https://github.com/pytest-dev/pytest/issues/11714

Also re-enable the pytestdev test environment.

ConorMacBride avatar Dec 17 '23 16:12 ConorMacBride

Actually I didn't really upgrade to new style. I simply copy-pasted the suggested workaround by pytest dev, so maybe you should re-open this issue. I apologize for any inconvenience caused.

pllim avatar Jan 10 '24 21:01 pllim

Yes, I realised that, but I think how you fixed it is better. The pluggy documentation now recommends using force_exception so we are effectively adding proper support for newer pluggy versions, regardless of the pytest version installed.

To add the new-style hook wrappers we'd need to do version checks on pytest to decide which kwargs to pass to the hooks, which might be unnecessary mess? The old-style hook wrappers will likely be supported for a long time yet. I'll reopen this issue though, as we should upgrade at some point. v1.0.0 would probably make sense.

ConorMacBride avatar Jan 10 '24 21:01 ConorMacBride

Pluggy 1.4.0 (just released) now warns about old-style hook wrappers (xref #221). This breaks any CI that treats warnings as errors.

neutrinoceros avatar Jan 24 '24 17:01 neutrinoceros