Closed sassanh closed 1 month ago
and ugly (using the callstack)
I would probably implement it by checking the call stack too, as the final solution.
Actually I think checking the call stack is better than module patching, because a Path
object may be imported in another module (not listed in skipped modules) and passed to as an argument to a function in this module, module patching wouldn't work well and one would require hacks like this: https://github.com/sassanh/python-redux/blob/main/redux_pytest/fixtures/snapshot.py#L92
Do you have a scenario in head for which checking call stack would cause trouble/unexpected behavior.
Do you have a scenario in head for which checking call stack would cause trouble/unexpected behavior.
Probably not. I just didn't like it much, but you may be right.
I had that (using the callstack) in mind to use for all functions, but thought that there should be a better way. But as I wrote, this didn't work out. So, you are probably right that this is the way to go - I was just reluctant as I find it somewhat hacky. And with the callstack, you could just do it a single place, so it would probably be ok.
I would probably implement it by checking the call stack too, as the final solution.
So, you are going to make another PR? Would be awesome!
So, you are going to make another PR? Would be awesome!
I will try.
Describe the bug
Path().exists
andPath().unlink
for example don't work well withadditional_skip_names
.Context: https://github.com/pytest-dev/pyfakefs/issues/1021#issuecomment-2132637499