Skip to content

Make stand-alone usage of fake modules besides FakeOsModule possible #1184

Open
@mrbean-bremen

Description

@mrbean-bremen

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions