Skip to content

Commit 13e9404

Browse files
committed
We never use pprint
1 parent 0b2c833 commit 13e9404

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

‎hypothesis-python/src/hypothesis/vendor/pretty.py‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
This module is based on ruby's `prettyprint.rb` library by `Tanaka Akira`.
2121
Example Usage
2222
-------------
23-
To directly print the representation of an object use `pprint`::
24-
from pretty import pprint
25-
pprint(complex_object)
2623
To get a string of the output use `pretty`::
2724
from pretty import pretty
2825
string = pretty(complex_object)
@@ -73,15 +70,13 @@ def _repr_pretty_(self, p, cycle):
7370
import datetime
7471
import platform
7572
import re
76-
import sys
7773
import types
7874
from collections import deque
7975
from contextlib import contextmanager
8076
from io import StringIO
8177

8278
__all__ = [
8379
"pretty",
84-
"pprint",
8580
"PrettyPrinter",
8681
"RepresentationPrinter",
8782
"for_type_by_name",
@@ -120,19 +115,6 @@ def pretty(
120115
return stream.getvalue()
121116

122117

123-
def pprint(
124-
obj, verbose=False, max_width=79, newline="\n", max_seq_length=MAX_SEQ_LENGTH
125-
):
126-
"""Like `pretty` but print to stdout."""
127-
printer = RepresentationPrinter(
128-
sys.stdout, verbose, max_width, newline, max_seq_length=max_seq_length
129-
)
130-
printer.pretty(obj)
131-
printer.flush()
132-
sys.stdout.write(newline)
133-
sys.stdout.flush()
134-
135-
136118
class _PrettyPrinterBase:
137119
@contextmanager
138120
def indent(self, indent):

‎hypothesis-python/tests/cover/test_pretty.py‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
from hypothesis.internal.compat import PYPY
6262
from hypothesis.vendor import pretty
6363

64-
from tests.common.utils import capture_out
65-
6664

6765
class MyList:
6866
def __init__(self, content):
@@ -546,13 +544,6 @@ def test_cyclic_set():
546544
assert pretty.pretty(x) == "{{...}}"
547545

548546

549-
def test_pprint():
550-
t = {"hi": 1}
551-
with capture_out() as o:
552-
pretty.pprint(t)
553-
assert o.getvalue().strip() == pretty.pretty(t)
554-
555-
556547
class BigList(list):
557548
def _repr_pretty_(self, printer, cycle):
558549
if cycle:

0 commit comments

Comments
 (0)