Different behaviour if the directory exists on the real file system, or not (sqlite3) #852
-
Describe the bug How To Reproduce
Here's the complete output of the tests:
Your environment Linux-5.15.0-76-generic-x86_64-with-glibc2.35
Python 3.11.4 (main, Jun 30 2023, 17:25:36) [GCC 11.3.0]
pyfakefs 5.2.2
pytest 7.4.0 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Thanks for the report! Without looking into that I suspect that this is a case of a pyfakefs limitation, given that I will have a closer look some time later. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, as I suspected, |
Beta Was this translation helpful? Give feedback.
-
I think I have found a possible workaround. I did it that way: first I store a reference to the original sqlite3.connect function, then the side_effect function
|
Beta Was this translation helpful? Give feedback.
Unfortunately, as I suspected,
sqlite3
will not work nicely withpyfakefs
. Opening files is done using the C interface ofsquite3
itself (e.g.sqlite3_open
and related functions), and there is no way to patch this in Python code.I will probably add
sqlite3
to the list of modules not working with pyfakefs.I've also just opened a new category "limitations" in the discussions, where I will move this and related issues.