diff options
author | Ronny Pfannschmidt <ronny.pfannschmidt@redhat.com> | 2017-01-19 13:05:58 +0100 |
---|---|---|
committer | Ronny Pfannschmidt <ronny.pfannschmidt@redhat.com> | 2017-01-19 13:05:58 +0100 |
commit | 250597d468149121fd6d8ae8f867fbe8faf843a2 (patch) | |
tree | 0d5610ebfc36967947c81670c3dda9a464b59e7e /_pytest/compat.py | |
parent | 123289a88ee01cfc3083fee22e0161cf4c9e4087 (diff) | |
download | pytest-250597d468149121fd6d8ae8f867fbe8faf843a2.tar.gz |
get_real_func: use saferepr when formatting the error message
Diffstat (limited to '_pytest/compat.py')
-rw-r--r-- | _pytest/compat.py | 4 |
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 |