Restore proper handling of '%' in assertion messages
This commit is contained in:
parent
eb90f3d1c8
commit
fcbe66feba
|
@ -358,7 +358,7 @@ def _format_assertmsg(obj):
|
||||||
# contains a newline it gets escaped, however if an object has a
|
# contains a newline it gets escaped, however if an object has a
|
||||||
# .__repr__() which contains newlines it does not get escaped.
|
# .__repr__() which contains newlines it does not get escaped.
|
||||||
# However in either case we want to preserve the newline.
|
# However in either case we want to preserve the newline.
|
||||||
replaces = [("\n", "\n~")]
|
replaces = [("\n", "\n~"), ("%", "%%")]
|
||||||
if not isinstance(obj, str):
|
if not isinstance(obj, str):
|
||||||
obj = saferepr(obj)
|
obj = saferepr(obj)
|
||||||
replaces.append(("\\n", "\n~"))
|
replaces.append(("\\n", "\n~"))
|
||||||
|
|
Loading…
Reference in New Issue