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

Function initializer_mock

tests/unitutil/mock.py:62–69  ·  view source on GitHub ↗

Return mock for __init__() method on `cls`. The patch is reversed after pytest uses it.

(request: FixtureRequest, cls: type, autospec: bool = True, **kwargs: Any)

Source from the content-addressed store, hash-verified

60
61
62def initializer_mock(request: FixtureRequest, cls: type, autospec: bool = True, **kwargs: Any):
63 """Return mock for __init__() method on `cls`.
64
65 The patch is reversed after pytest uses it.
66 """
67 _patch = patch.object(cls, "__init__", autospec=autospec, return_value=None, **kwargs)
68 request.addfinalizer(_patch.stop)
69 return _patch.start()
70
71
72def instance_mock(

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…