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

Method __init__

src/_pytest/_io/saferepr.py:44–56  ·  view source on GitHub ↗

:param maxsize: If not None, will truncate the resulting repr to that specific size, using ellipsis somewhere in the middle to hide the extra text. If None, will not impose any size limits on the returning repr.

(self, maxsize: Optional[int])

Source from the content-addressed store, hash-verified

42 """
43
44 def __init__(self, maxsize: Optional[int]) -> None:
45 """
46 :param maxsize:
47 If not None, will truncate the resulting repr to that specific size, using ellipsis
48 somewhere in the middle to hide the extra text.
49 If None, will not impose any size limits on the returning repr.
50 """
51 super().__init__()
52 # ``maxstring`` is used by the superclass, and needs to be an int; using a
53 # very large number in case maxsize is None, meaning we want to disable
54 # truncation.
55 self.maxstring = maxsize if maxsize is not None else 1_000_000_000
56 self.maxsize = maxsize
57
58 def repr(self, x: object) -> str:
59 try:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected