Fix usages of py.io.saferepr

This commit is contained in:
Anthony Sottile
2019-01-20 10:45:12 -08:00
parent 095ce2ca7f
commit 0c6ca0da62
8 changed files with 27 additions and 25 deletions

View File

@@ -18,6 +18,7 @@ import six
from six import text_type
import _pytest
from _pytest._io.saferepr import saferepr
from _pytest.compat import _PY2
from _pytest.compat import _PY3
from _pytest.compat import PY35
@@ -144,7 +145,7 @@ class Frame(object):
def repr(self, object):
""" return a 'safe' (non-recursive, one-line) string repr for 'object'
"""
return py.io.saferepr(object)
return saferepr(object)
def is_true(self, object):
return object
@@ -423,7 +424,7 @@ class ExceptionInfo(object):
if exprinfo is None and isinstance(tup[1], AssertionError):
exprinfo = getattr(tup[1], "msg", None)
if exprinfo is None:
exprinfo = py.io.saferepr(tup[1])
exprinfo = saferepr(tup[1])
if exprinfo and exprinfo.startswith(cls._assert_start_repr):
_striptext = "AssertionError: "
@@ -620,7 +621,7 @@ class FormattedExcinfo(object):
return source
def _saferepr(self, obj):
return py.io.saferepr(obj)
return saferepr(obj)
def repr_args(self, entry):
if self.funcargs: