Skip to content

Commit 64b5b66

Browse files
pprint: Remove the option to add underscore for numbers
This is never used, we can remove this. If we wanted instead, we could always enable it
1 parent 6aa35f7 commit 64b5b66

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/_pytest/_io/pprint.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ def __init__(
6464
indent: int = 4,
6565
width: int = 80,
6666
depth: Optional[int] = None,
67-
*,
68-
underscore_numbers: bool = False,
6967
) -> None:
7068
"""Handle pretty printing operations onto a stream using a set of
7169
configured parameters.
@@ -91,7 +89,6 @@ def __init__(
9189
self._depth = depth
9290
self._indent_per_level = indent
9391
self._width = width
94-
self._underscore_numbers = underscore_numbers
9592

9693
def pformat(self, object: Any) -> str:
9794
sio = _StringIO()
@@ -603,12 +600,6 @@ def _safe_repr(
603600

604601
r = getattr(typ, "__repr__", None)
605602

606-
if issubclass(typ, int) and r is int.__repr__:
607-
if self._underscore_numbers:
608-
return f"{object:_d}"
609-
else:
610-
return repr(object)
611-
612603
if issubclass(typ, dict) and r is dict.__repr__:
613604
if not object:
614605
return "{}"
@@ -659,7 +650,9 @@ def _safe_repr(
659650
return repr(object)
660651

661652

662-
_builtin_scalars = frozenset({str, bytes, bytearray, float, complex, bool, type(None)})
653+
_builtin_scalars = frozenset(
654+
{str, bytes, bytearray, float, complex, bool, type(None), int}
655+
)
663656

664657

665658
def _recursion(object: Any) -> str:

0 commit comments

Comments
 (0)