-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch os.DirEntry #533
Comments
There is currently no straightforward way to add this in pyfakefs (the patching works not as in |
Well, essentially I have a bunch of functions that accept path-like objects as input - and It's certainly not a high-priority issue, but it'd be nice if my test suite didn't have to do so much manual monkeypatching :) I don't understand why this isn't an easy fix, though? Other path-related functions and classes like |
Ah, ok, but in that case it may be better to check if it has an As for the other attributes - for patched functions this isn't an issue, and for |
I did not succeed in fixing this (had several tries) - closing now, as this is a documented limitation in |
Is your feature request related to a problem? Please describe.
pyfakefs doesn't patch
os.DirEntry
, which has the unfortunate side effect thatos.scandir
yields objects for which the checkisinstance(direntry, os.DirEntry)
fails.Describe the solution you'd like
os.DirEntry
should be replaced withpyfakefs.fake_scandir.DirEntry
as long as pyfakefs is active.Describe alternatives you've considered
...none?
Code snippet that demonstrates the problem:
The text was updated successfully, but these errors were encountered: