#25188: inconsistent escaping in assertRaisesMessage test output
-----------------------------------+---------------------------------
Reporter: cjerdonek | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Keywords: assertRaisesMessage
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+---------------------------------
If `assertRaisesMessage` fails with differing exception text, then the
test output escapes the two strings differently in the display.
For example--
{{{#!python
def test(self):
with self.assertRaisesMessage(Exception, "two words"):
raise Exception("no, three words")
}}}
yields--
{{{
----------------------------------------------------------------------
Exception: no, three words
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "***.py", line 178, in test
raise Exception("no, three words")
AssertionError: "two\ words" does not match "no, three words"
}}}
Observe the spurious slash ("\") before the space. The test output is
especially annoying if the string is long and has many spaces. It can
look something like--
{{{
\{\
\ \ \ \ \"
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25188>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.310842b8fbacced95abeb4df21409431%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.