MCPcopy
hub / github.com/pytest-dev/pytest / __eq__

Method __eq__

src/_pytest/python_api.py:203–217  ·  view source on GitHub ↗
(self, actual)

Source from the content-addressed store, hash-verified

201 )
202
203 def __eq__(self, actual) -> bool:
204 import numpy as np
205
206 # self.expected is supposed to always be an array here.
207
208 if not np.isscalar(actual):
209 try:
210 actual = np.asarray(actual)
211 except Exception as e:
212 raise TypeError(f"cannot compare '{actual}' to numpy.ndarray") from e
213
214 if not np.isscalar(actual) and actual.shape != self.expected.shape:
215 return False
216
217 return super().__eq__(actual)
218
219 def _yield_comparisons(self, actual):
220 import numpy as np

Callers

nothing calls this directly

Calls 1

__eq__Method · 0.45

Tested by

no test coverage detected