pyfakefs icon indicating copy to clipboard operation
pyfakefs copied to clipboard

Shutting down patching during pytest report logging shall be more reliable

Open mrbean-bremen opened this issue 1 year ago • 0 comments

This is a spin-off of #904. From the comments:

mrbean-bremen commented Nov 12, 2023

@RonnyPfannschmidt - thanks, that worked exactly as you wrote, I'll probably merge this tomorrow if nobody objects. Sorry about the long delay - I wanted to finish a minor issue in another project first, but that took unexpectedly long.

One question though: I used pytest_runtest_logreport with tryfirst. If anyone else uses the same hook also with tryfirst and wants to access the filesystem in that hook, that might or might not work, depending on the order the hooks are called (if I understand that correctly). Is this something I just have to live with (as it is unlikely to happen), or is there a canocical way to handle this?

RonnyPfannschmidt commented Nov 12, 2023

Currently there's no explicit order, I recommend a tryfirst hook wrapper as starting point plus logged a issue that's dependents on The pluggy issues about more explicit ordering


There are some issues in pluggy related to ordering, the first being this issue.

This is a reminder to use the improved mechanism to ensure that pyfakefs is paused before other implementer of the reporting hook are involved, if such a mechanism will be added.

mrbean-bremen avatar Nov 12 '23 14:11 mrbean-bremen