Open
Description
There are use cases to use the patched modules separately from the Patcher
and all derived methods.
This was actually the original usage at Google, before the Patcher and the related infrastructure had been added by @jmcgeheeiv, and came up recently for example in #1171.
Currently, only the os
module can be reliably patched as a standalone module, both because some global patching is done in the Patcher code, and because other modules may depend on one another.
It shall be possible to use other patched modules seamlessly without the need for the Patcher (or the related fixture/testcase class/decorator). This is related to the patched shutil
, pathlib
, io
and possibly tempfile
modules.