Open sassanh opened 1 month ago
This is mostly brainstorm material to see if we want to go in this direction.
Implementation details:
Most of the job is done as a filter in wrapper functions, is_called_from_skipped_module
starts from the end of the call stack and goes up until it reaches a module that is:
tests/
and pytest_tests/
directories)
This module is considered the module that is calling the wrapped function and if it is listed in skip_names
, then it will try to run the original function instead of the fake wrapped function.It is working for Python 3.12, 3.11 and mostly 3.10, but 3.9, 3.8 and 3.7 have yet different internals for pathlib.
@mrbean-bremen When you got the time, please check it and let me know if you approve this approach. If it looks good to you, I will work on tests for other Python versions and Windows.
Describe the changes
Add a call stack check for fake filesystem,
os
andos.path
methods in theirhandle_original_call
wrapper to see if they are being called from a module listed inskip_modules
.Tasks