-
Notifications
You must be signed in to change notification settings - Fork 91
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
pyfakefs cannot fake open calls if module has specific names #708
Comments
The workaround is
where "io" is the name of the module that's causing the trouble. |
Thanks - that is indeed a shortcoming of pyfakefs, it just never came up before. I think it is a valid use case and we see how this can be avoided (probably by skipping modules not solely based on their name). |
- allows using own modules with the same name - fixes pytest-dev#708
- allows using own modules with the same name - fixes #708
…h the same name - fixes #708
@marnanel - should be fixed in master now - please check if it works for you! |
Working fine here. Thanks for the fast response! |
Describe the bug
If a module under test has a name listed in
FakeIoModule.skip_names
, thenopen
calls are never faked.For example, one of these names is
io.py
. Issue #569 solved the same problem for names ending with that string, such aslogsio.py
. But a submodule within any package may reasonably have the exact nameio.py
, and this will trigger the behaviour nonetheless.How To Reproduce
Example code is in https://github.com/marnanel/pyfakefs-issue . Running the test in that repo gets you a
FileNotFoundError
when the code inwombat.io
attempts to access the file created in the fake filesystem by the test.Environment
The text was updated successfully, but these errors were encountered: