#27539: assertNumQueries fails if debug cursor wrapper fills
-----------------------------------+-------------------------------------
Reporter: Malcolm Box | Owner: reficul31
Type: Bug | Status: assigned
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------------------
Changes (by reficul31):
* needs_docs: 1 => 0
Comment:
Thank you @timograham for the help. I have attached a file with the
traceback. I might be wrong but I strongly feel the clear queries_log
method should be placed in the ```__exit__``` of the
CaptureQueriesContext. Again I might be wrong but TransactionTestCase as
far as I could understand was for the resetting of the Database settings.
Whereas the queries_log is stored in the BaseDatabaseWrapper object. To
reset the log after every test case we could do it in
```_AssertNumQueries.__exit__``` method. Also resetting the log after
every testcase might work but I was thinking in an unlikely scenario where
a single test sends over 9000 queries.(I know unrealistic but imagine)
--
Ticket URL: <https://code.djangoproject.com/ticket/27539#comment:12>
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/062.f9073df4bb84931a51dcbeef2fe32702%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.