Merge the AlwaysDispathPrettyPrinter into the now vendored PrettyPrinter
We don't need to keep the separation anymore, and this will make it easier to extend
This commit is contained in:
8
testing/io/test_pprint.py
Normal file
8
testing/io/test_pprint.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from _pytest._io.pprint import PrettyPrinter
|
||||
|
||||
|
||||
def test_pformat_dispatch():
|
||||
printer = PrettyPrinter(width=5)
|
||||
assert printer.pformat("a") == "'a'"
|
||||
assert printer.pformat("a" * 10) == "'aaaaaaaaaa'"
|
||||
assert printer.pformat("foo bar") == "('foo '\n 'bar')"
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
from _pytest._io.saferepr import _pformat_dispatch
|
||||
from _pytest._io.saferepr import DEFAULT_REPR_MAX_SIZE
|
||||
from _pytest._io.saferepr import saferepr
|
||||
from _pytest._io.saferepr import saferepr_unlimited
|
||||
@@ -159,12 +158,6 @@ def test_unicode():
|
||||
assert saferepr(val) == reprval
|
||||
|
||||
|
||||
def test_pformat_dispatch():
|
||||
assert _pformat_dispatch("a") == "'a'"
|
||||
assert _pformat_dispatch("a" * 10, width=5) == "'aaaaaaaaaa'"
|
||||
assert _pformat_dispatch("foo bar", width=5) == "('foo '\n 'bar')"
|
||||
|
||||
|
||||
def test_broken_getattribute():
|
||||
"""saferepr() can create proper representations of classes with
|
||||
broken __getattribute__ (#7145)
|
||||
|
||||
Reference in New Issue
Block a user