[Django] #30676: Add a --pdb option to the test runner

13 views
Skip to first unread message

Django

unread,
Aug 4, 2019, 8:10:16 PM8/4/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
---------------------------------------------+------------------------
Reporter: Andrew Godwin | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
The Django test runner currently does not offer a {{{--pdb}}} option like
pytest (which, when a test fails, pops open a PDB debugger at that
location). This would be incredibly valuable for debugging tests, and I
feel we should add it.

Because of the multi-process nature of the test runner, this would only be
possible if we were running with {{{--parallel=1}}}.

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

Django

unread,
Aug 4, 2019, 11:25:35 PM8/4/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-----------------------------------+------------------------------------

Reporter: Andrew Godwin | Owner: nobody
Type: New feature | Status: new

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

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Simon Charette):

* type: Uncategorized => New feature
* stage: Unreviewed => Accepted


Comment:

We should probably make the option default to `ipdb` if it's installed
like we do with `manage.py shell` for IPython.

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

Django

unread,
Aug 5, 2019, 12:10:47 AM8/5/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Andrew Godwin):

* status: new => assigned
* owner: nobody => Andrew Godwin


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

Django

unread,
Aug 5, 2019, 12:12:06 AM8/5/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | 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 Andrew Godwin):

Agreed - I have opened a [https://github.com/django/django/pull/11629 PR]
with my solution for this.

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

Django

unread,
Aug 5, 2019, 12:12:22 AM8/5/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Andrew Godwin):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:4>

Django

unread,
Aug 5, 2019, 8:30:54 AM8/5/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:5>

Django

unread,
Aug 5, 2019, 9:29:31 PM8/5/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Markus Holtermann):

* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:6>

Django

unread,
Aug 6, 2019, 6:17:54 AM8/6/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

This is great.

> ...this would only be possible if we were running with
{{{--parallel=1}}}.

As per my comment on the PR, if I pass `--pdb` could `--parallel=1` be
implied? (I **always** want that right?)

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:7>

Django

unread,
Aug 6, 2019, 6:59:44 PM8/6/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Andrew Godwin):

I wasn't super happy about implying it, but I guess we could?

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:8>

Django

unread,
Aug 7, 2019, 1:13:26 AM8/7/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

OK. (We can always come back if people decide they want that.). Good work.

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:9>

Django

unread,
Aug 7, 2019, 2:17:14 AM8/7/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"052388aba47ba7166886fc741cac5ce3b22fea58" 052388ab]:
{{{
#!CommitTicketReference repository=""
revision="052388aba47ba7166886fc741cac5ce3b22fea58"
Fixed #30676 -- Added --pdb option to test runner.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:10>

Django

unread,
Dec 9, 2019, 5:13:28 AM12/9/19
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"f46452638885d89cacfca6831e0b9982c87b6527" f4645263]:
{{{
#!CommitTicketReference repository=""
revision="f46452638885d89cacfca6831e0b9982c87b6527"
Refs #30676 -- Added test for invalid --pdb and --parallel usage in
DiscoverRunner.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:11>

Django

unread,
Jul 10, 2020, 1:28:49 PM7/10/20
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2c43840dfba42ed02574a270d826fda08e4b50d1" 2c43840]:
{{{
#!CommitTicketReference repository=""
revision="2c43840dfba42ed02574a270d826fda08e4b50d1"
Refs #30676 -- Added pdb argument to DiscoverRunner docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:12>

Django

unread,
Jul 10, 2020, 1:29:50 PM7/10/20
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"33457aa3cfc775c2939547212fbb403c46c9afd9" 33457aa3]:
{{{
#!CommitTicketReference repository=""
revision="33457aa3cfc775c2939547212fbb403c46c9afd9"
[3.1.x] Refs #30676 -- Added pdb argument to DiscoverRunner docs.

Backport of 2c43840dfba42ed02574a270d826fda08e4b50d1 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:13>

Django

unread,
Jul 10, 2020, 1:31:29 PM7/10/20
to django-...@googlegroups.com
#30676: Add a --pdb option to the test runner
-------------------------------------+-------------------------------------
Reporter: Andrew Godwin | Owner: Andrew
| Godwin
Type: New feature | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"b44e2d62c0993589726914b4edf8f6063abac257" b44e2d62]:
{{{
#!CommitTicketReference repository=""
revision="b44e2d62c0993589726914b4edf8f6063abac257"
[3.0.x] Refs #30676 -- Added pdb argument to DiscoverRunner docs.

Backport of 2c43840dfba42ed02574a270d826fda08e4b50d1 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30676#comment:14>

Reply all
Reply to author
Forward
0 new messages