Skip to content

Commit

Permalink
get_real_func: use saferepr when formatting the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jan 19, 2017
1 parent 123289a commit 250597d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ def get_real_func(obj):
else:
raise ValueError(
("could not find real function of {start}"
"\nstopped at {current}").format(start=start_obj, current=obj))
"\nstopped at {current}").format(
start=py.io.saferepr(start_obj),
current=py.io.saferepr(obj)))
if isinstance(obj, functools.partial):
obj = obj.func
return obj
Expand Down

0 comments on commit 250597d

Please sign in to comment.