summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2019-06-26 18:51:14 -0300
committerBruno Oliveira <nicoddemus@gmail.com>2019-06-26 18:51:27 -0300
commitfcbe66feba83b5991d093cc5e42a46001e46cab0 (patch)
tree720b08e162e780f4524ce0340f32df07938e0b2e /src
parenteb90f3d1c89a10a00b5cd34a5df3aaaaec500177 (diff)
downloadpytest-fcbe66feba83b5991d093cc5e42a46001e46cab0.tar.gz
Restore proper handling of '%' in assertion messages
Diffstat (limited to 'src')
-rw-r--r--src/_pytest/assertion/rewrite.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py
index 62d8dbb6a..7b098ad1b 100644
--- a/src/_pytest/assertion/rewrite.py
+++ b/src/_pytest/assertion/rewrite.py
@@ -358,7 +358,7 @@ def _format_assertmsg(obj):
# contains a newline it gets escaped, however if an object has a
# .__repr__() which contains newlines it does not get escaped.
# However in either case we want to preserve the newline.
- replaces = [("\n", "\n~")]
+ replaces = [("\n", "\n~"), ("%", "%%")]
if not isinstance(obj, str):
obj = saferepr(obj)
replaces.append(("\\n", "\n~"))