MCPcopy Create free account
hub / github.com/scanny/python-pptx / open_mock

Function open_mock

tests/unitutil/mock.py:111–116  ·  view source on GitHub ↗

Return a mock for the builtin `open()` method in `module_name`.

(request: FixtureRequest, module_name: str, **kwargs: Any)

Source from the content-addressed store, hash-verified

109
110
111def open_mock(request: FixtureRequest, module_name: str, **kwargs: Any):
112 """Return a mock for the builtin `open()` method in `module_name`."""
113 target = "%s.open" % module_name
114 _patch = patch(target, mock_open(), create=True, **kwargs)
115 request.addfinalizer(_patch.stop)
116 return _patch.start()
117
118
119def property_mock(request: FixtureRequest, cls: type, prop_name: str, **kwargs: Any):

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…