You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm a maintainer for pyfakefs and currently trying to make it play nice with pytest-subtests (see this issue).
As pyfakefs patches the filesystem, I have to make sure that it is not active during reporting, so I currently suspend patching in pytest_runtest_logreport and resume it (provided the fixture is still active) in pytest_runtest_call.
This does not work with subtests, as pytest_runtest_logreport is called before each subtest (which suspends patching), but pytest_runtest_call is not, and I failed to find a hook to switch it back on before the next subtest. Is there a possibility (hook or otherwise) to get notified before a subtest is run which I can rely on?
Thanks!
The text was updated successfully, but these errors were encountered:
i just took note that the fix for pytest-dev/pyfakefs#904 is incorrect
i recommended a tryfirst hookwrapper as the hookwrapper can undo the suspense in the hook itself
I have to admit that I didn't know about hookwrappers - completely overlooked them in the documentation - so I probably just misunderstood that in your suggestion. A hookwrapper is quite useful and exactly what I was looking for, thanks!
Hi,
I'm a maintainer for
pyfakefs
and currently trying to make it play nice withpytest-subtests
(see this issue).As
pyfakefs
patches the filesystem, I have to make sure that it is not active during reporting, so I currently suspend patching inpytest_runtest_logreport
and resume it (provided the fixture is still active) inpytest_runtest_call
.This does not work with subtests, as
pytest_runtest_logreport
is called before each subtest (which suspends patching), butpytest_runtest_call
is not, and I failed to find a hook to switch it back on before the next subtest. Is there a possibility (hook or otherwise) to get notified before a subtest is run which I can rely on?Thanks!
The text was updated successfully, but these errors were encountered: