summaryrefslogtreecommitdiff
path: root/_pytest/compat.py
diff options
context:
space:
mode:
authorRonny Pfannschmidt <ronny.pfannschmidt@redhat.com>2017-01-19 13:05:58 +0100
committerRonny Pfannschmidt <ronny.pfannschmidt@redhat.com>2017-01-19 13:05:58 +0100
commit250597d468149121fd6d8ae8f867fbe8faf843a2 (patch)
tree0d5610ebfc36967947c81670c3dda9a464b59e7e /_pytest/compat.py
parent123289a88ee01cfc3083fee22e0161cf4c9e4087 (diff)
downloadpytest-250597d468149121fd6d8ae8f867fbe8faf843a2.tar.gz
get_real_func: use saferepr when formatting the error message
Diffstat (limited to '_pytest/compat.py')
-rw-r--r--_pytest/compat.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/_pytest/compat.py b/_pytest/compat.py
index 09f681c86..e097dee51 100644
--- a/_pytest/compat.py
+++ b/_pytest/compat.py
@@ -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