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

Function method_mock

tests/unitutil/mock.py:99–108  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

97
98
99def method_mock(
100 request: FixtureRequest, cls: type, method_name: str, autospec: bool = True, **kwargs: Any
101):
102 """Return mock for method `method_name` on `cls`.
103
104 The patch is reversed after pytest uses it.
105 """
106 _patch = patch.object(cls, method_name, autospec=autospec, **kwargs)
107 request.addfinalizer(_patch.stop)
108 return _patch.start()
109
110
111def open_mock(request: FixtureRequest, module_name: str, **kwargs: Any):

Callers 15

from_blob_Method · 0.85
index_Method · 0.85
_iter_Method · 0.85
_clear_click_action_Method · 0.85
_find_by_sha1_Method · 0.85
_iter_Method · 0.85
_find_by_sha1_Method · 0.85
_iter_Method · 0.85
_write_cat_column_Method · 0.85
_write_categories_Method · 0.85

Calls

no outgoing calls

Tested by 15

from_blob_Method · 0.68
index_Method · 0.68
_iter_Method · 0.68
_clear_click_action_Method · 0.68
_find_by_sha1_Method · 0.68
_iter_Method · 0.68
_find_by_sha1_Method · 0.68
_iter_Method · 0.68
_write_cat_column_Method · 0.68
_write_categories_Method · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…