MCPcopy Create free account
hub / github.com/pytest-dev/pytest / _yield_comparisons

Method _yield_comparisons

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

Source from the content-addressed store, hash-verified

225 return super().__eq__(actual)
226
227 def _yield_comparisons(self, actual):
228 import numpy as np
229
230 # `actual` can either be a numpy array or a scalar, it is treated in
231 # `__eq__` before being passed to `ApproxBase.__eq__`, which is the
232 # only method that calls this one.
233
234 if np.isscalar(actual):
235 for i in np.ndindex(self.expected.shape):
236 yield actual, self.expected[i].item()
237 else:
238 for i in np.ndindex(self.expected.shape):
239 yield actual[i].item(), self.expected[i].item()
240
241
242class ApproxMapping(ApproxBase):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected