Consider replacing fake_filesystem with pyfakefs
#6548
Replies: 1 comment
-
|
Thanks for the suggestion @TheRealFalcon. We are open to consider a contribution that uses this approach, especially if an initial implementation keeps the We would prefer to use stable features to keep compatibility across releases: targeting a maximum version of 4.5.4 or perhaps earlier. This of course means a bit greater risk in behavior differences due to spanning across major releases: but again keeping patch size small would help mitigate that risk in case a revert is needed on older distros. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
fake_filesystem is showing its age. It doesn't work for many (any?) pathlib related functions, there are still some older lower-level libraries it doesn't patch or can't easily patch, and there's no easy way to disable it in the middle of a test.
Meanwhile, pyfakefs has been actively maintained for years, already exists in most downstreams and supports more functionality, like patching the entire filesystem (including usage of pathlib), bypassing the patching, and pausing and resuming patching in the middle of a test.
I don't think migration would be hard as we could still use the
fake_filesystemfixture as a shim, but instead just allow calling new methods on it.Thoughts? Would upstream be open to me making this change?
Beta Was this translation helpful? Give feedback.
All reactions