#24827: assertRaisesMessage() fails with Python 2.7.10~rc1
-----------------------------------+--------------------
     Reporter:  rhertzog           |      Owner:  nobody
         Type:  Uncategorized      |     Status:  new
    Component:  Testing framework  |    Version:  1.8
     Severity:  Normal             |   Keywords:
 Triage Stage:  Unreviewed         |  Has patch:  0
Easy pickings:  0                  |      UI/UX:  0
-----------------------------------+--------------------
 Currently Debian Unstable has Python 2.7.10~rc1 and the Django test suite
 is falling apart since all calls to assertRaisesMessage() fail. All those
 errrors are gone when I run the test in Debian 8 Jessie with Python 2.7.9.

 I'm not sure if it's a Python bug or a Django bug.

 Here are two examples of failures in the test suite:

 {{{
 ======================================================================
 ERROR: test_avoid_infinite_loop_on_too_many_subqueries
 (queries.tests.Queries1Tests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/«PKGBUILDDIR»/tests/queries/tests.py", line 393, in
 test_avoid_infinite_loop_on_too_many_subquer
 ies
     with self.assertRaisesMessage(RuntimeError, msg):
   File "/«PKGBUILDDIR»/django/test/testcases.py", line 582, in
 assertRaisesMessage
     re.escape(expected_message), callable_obj, *args, **kwargs)
   File "/«PKGBUILDDIR»/django/utils/six.py", line 643, in
 assertRaisesRegex
     return getattr(self, _assertRaisesRegex)(*args, **kwargs)
   File "/usr/lib/python2.7/unittest/case.py", line 995, in
 assertRaisesRegexp
     callable_obj(*args, **kwargs)
 TypeError: 'NoneType' object is not callable

 ======================================================================
 FAIL: test_recipients_as_string (mail.tests.MailTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/«PKGBUILDDIR»/tests/mail/tests.py", line 115, in
 test_recipients_as_string
     with self.assertRaisesMessage(TypeError, '"to" argument must be a list
 or tuple'):
   File "/«PKGBUILDDIR»/django/test/testcases.py", line 582, in
 assertRaisesMessage
     re.escape(expected_message), callable_obj, *args, **kwargs)
   File "/«PKGBUILDDIR»/django/utils/six.py", line 643, in
 assertRaisesRegex
     return getattr(self, _assertRaisesRegex)(*args, **kwargs)
 AssertionError: "\"to\"\ argument\ must\ be\ a\ list\ or\ tuple" does not
 match "'NoneType' object is not callable"
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24827>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.bdf40284bccd990168173cb8157e2eb3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to