Opened 5 years ago

Closed 5 years ago

#16185 closed New feature (fixed)

Allow to override TEST_RUNNER setting with a command-line option to 'manage.py 'test'

Reported by: Dmitry Jemerov Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Normal Keywords:
Cc: msiedlarek Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In order to enable the integration of the Django test framework with IDE test runners, it's useful to be able to replace or decorate the test runner specified by the TEST_RUNNER setting in settings.py. Currently, the only way to do so is to provide our own settings.py which imports the user's settings.py and then changes the TEST_RUNNER setting. This is ugly and not always works.

A much preferred solution is to be able to override the test runner with a command line option passed to 'manage.py test'.

I've discussed this approach with russelm at the DjangoCon.EU sprint, and it was approved in general.

Attachments (1)

16185_15675.diff (9.3 KB) - added by Dmitry Jemerov 5 years ago.
Attached patch fixes this ticket along with ticket #15675 (it touches the same code so it's easier to fix both in the same patch)

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by Dmitry Jemerov

Attachment: 16185_15675.diff added

Attached patch fixes this ticket along with ticket #15675 (it touches the same code so it's easier to fix both in the same patch)

comment:1 Changed 5 years ago by Ernesto Rico-Schmidt

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Patch looks good, it applies without problem. The tests pass.

comment:2 Changed 5 years ago by msiedlarek

Cc: msiedlarek added

comment:3 Changed 5 years ago by Russell Keith-Magee

Triage Stage: AcceptedReady for checkin

comment:4 Changed 5 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

In [16352]:

Fixed #16185, #15675 -- Added the ability for test runners to define custom options, and to specify a custom test runner at the command line. Thanks to Dmitry Jemerov and Mikołaj Siedlarek for the patch.

Note: See TracTickets for help on using tickets.
Back to Top