MCPcopy Index your code
hub / github.com/python/cpython / equal_wrapper

Function equal_wrapper

Lib/test/test_xml_etree.py:132–138  ·  view source on GitHub ↗

Mock cls.__eq__ to check whether it has been called or not. The behaviour of cls.__eq__ (side-effects included) is left as is.

(cls)

Source from the content-addressed store, hash-verified

130
131
132def equal_wrapper(cls):
133 """Mock cls.__eq__ to check whether it has been called or not.
134
135 The behaviour of cls.__eq__ (side-effects included) is left as is.
136 """
137 eq = cls.__eq__
138 return mock.patch.object(cls, "__eq__", autospec=True, wraps=eq)
139
140
141def checkwarnings(*filters, quiet=False):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…