Code

Opened 3 years ago

Closed 3 years ago

#16185 closed New feature (fixed)

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

Reported by: intelliyole 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 intelliyole 3 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 3 years ago by intelliyole

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 3 years ago by nnrcschmdt

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

comment:2 Changed 3 years ago by msiedlarek

  • Cc msiedlarek added

comment:3 Changed 3 years ago by russellm

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 3 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.