#36435: CaptureQueriesContext can miss queries after nesting
-------------------------------------+-------------------------------------
               Reporter:  Adam       |          Owner:  Adam Johnson
  Johnson                            |
                   Type:  Bug        |         Status:  assigned
              Component:  Testing    |        Version:  dev
  framework                          |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 `CaptureQueriesContext.__exit__()`, as used by `assertNumQueries()`,
 unconditionally restores the `reset_queries` signal receiver. This
 behaviour can lead to missed queries when the context manager is nested
 and a request is made after the inner context manager exits.

 The solution is to restore the signal receiver in `__exit__()` only if it
 was removed in `__enter__()`.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36435>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019737dd96ec-6b15acdc-bd8b-4be2-801d-35a70bd1c756-000000%40eu-central-1.amazonses.com.

Reply via email to