[Django] #22320: assertNumQueries should capture call stacks

4 views
Skip to first unread message

Django

unread,
Mar 23, 2014, 12:34:01 PM3/23/14
to django-...@googlegroups.com
#22320: assertNumQueries should capture call stacks
-----------------------------------+--------------------
Reporter: boxm | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
When an assertNumQueries assertion fails there are two things that are
very helpful in diagnosing the issue: the SQL calls generated, and what
caused them. assertNumQueries does a good job with the former, but
provides no help with the latter.

If the CursorDebugWrapper kept track of the traceback for each query, it
would be simple to see what had caused any unexpected queries.

--
Ticket URL: <https://code.djangoproject.com/ticket/22320>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 23, 2014, 1:11:15 PM3/23/14
to django-...@googlegroups.com
#22320: assertNumQueries should capture call stacks
-----------------------------------+--------------------------------------

Reporter: boxm | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by boxm):

* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


Comment:

Patch available here:
https://github.com/mbox/django/commit/c0a5fa22770b90d3ad0fd24ee80b93bebe03fbec

--
Ticket URL: <https://code.djangoproject.com/ticket/22320#comment:1>

Django

unread,
Mar 23, 2014, 1:13:20 PM3/23/14
to django-...@googlegroups.com
#22320: assertNumQueries should capture call stacks
-----------------------------------+--------------------------------------

Reporter: boxm | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by boxm):

* version: 1.6 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/22320#comment:2>

Django

unread,
Mar 23, 2014, 4:34:32 PM3/23/14
to django-...@googlegroups.com
#22320: assertNumQueries should capture call stacks
-----------------------------------+--------------------------------------
Reporter: boxm | Owner: nobody
Type: New feature | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #9363

--
Ticket URL: <https://code.djangoproject.com/ticket/22320#comment:3>

Reply all
Reply to author
Forward
0 new messages