Escape % character in the assertion message. closes #604

--HG--
branch : test_for_issue_604
This commit is contained in:
Anatoly Bubenkov
2014-10-07 01:01:21 +02:00
parent 24468a6f34
commit e1aed27c15
4 changed files with 16 additions and 19 deletions

View File

@@ -373,7 +373,7 @@ def _format_assertmsg(obj):
t = py.builtin.text
else:
t = py.builtin.bytes
s = s.replace(t("\n"), t("\n~"))
s = s.replace(t("\n"), t("\n~")).replace(t("%"), t("%%"))
if is_repr:
s = s.replace(t("\\n"), t("\n~"))
return s