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

Method __repr__

src/_pytest/python_api.py:313–319  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

311 """Perform approximate comparisons where the expected value is a sequence of numbers."""
312
313 def __repr__(self) -> str:
314 seq_type = type(self.expected)
315 if seq_type not in (tuple, list, set):
316 seq_type = list
317 return "approx({!r})".format(
318 seq_type(self._approx_scalar(x) for x in self.expected)
319 )
320
321 def _repr_compare(self, other_side: Sequence[float]) -> List[str]:
322 import math

Callers

nothing calls this directly

Calls 2

_approx_scalarMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected