#28091: Hiding 'cursor does not exist' error doesn't work
-------------------------------------+-------------------------------------
     Reporter:  Claude Paroz         |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by François Freitag):

 I updated the test because my cursor creating was flawed. I should have
 used directly connection.chunked_cursor() instead of trying to be smart
 and use create_cursor().

 Fixing this error made the test fail with:
 {{{
 FAIL: test_cursor_close_failure_does_not_mask_original_exception
 (backends.tests.BackendTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/usr/lib64/python2.7/unittest/case.py", line 329, in run
     testMethod()
   File "/home/freitafr/dev/django/tests/backends/tests.py", line 700, in
 test_cursor_close_failure_does_not_mask_original_exception
     list(persons)
   File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
     self.gen.throw(type, value, traceback)
   File "/home/freitafr/dev/django/django/test/testcases.py", line 615, in
 _assert_raises_message_cm
     self.assertIn(expected_message, str(cm.exception))
   File "/usr/lib64/python2.7/unittest/case.py", line 803, in assertIn
     self.fail(self._formatMessage(msg, standardMsg))
   File "/usr/lib64/python2.7/unittest/case.py", line 410, in fail
     raise self.failureException(msg)
 AssertionError: u'Real exception raised by the database on cursor.execute'
 not found in 'Error when attempting to close the cursor, would mask the
 actual exception'
 }}}

 I opened [https://github.com/django/django/pull/8371 #8371] with a
 suggested way to fix this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/28091#comment:5>
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/065.fd306888e4f100196136d10d083b0d19%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to