Django

Code

Ticket #506 (closed: fixed)

Opened 3 years ago

Last modified 3 years ago

[patch] runtests.py should allow models to be tested individually

Reported by: Simon Willison Assigned to: adrian
Milestone: Component: Tools
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

While experimenting with some new unit tests I got frustrated having to wait for ALL the tests to run every time I used runtests.py. I've attached a patch which extends the script to take an optional list of model tests to run as command line arguments. If one or more models are specified, the additional (non-model) tests are not run.

Example usage:

$ runtests.py lookup m2m_intermediary -v 1
Running tests with database 'postgresql'
Creating test database
Initializing test database
Running app tests
lookup model: Importing
lookup model: Installing
lookup model: Running tests
m2m_intermediary model: Importing
m2m_intermediary model: Installing
m2m_intermediary model: Running tests
Deleting test database
All tests passed.

I've also moved the "24 errors" error count message to the bottom of the output - when you have several errors the message was scrolling off the screen.

Attachments

runtests-granular.patch (6.3 kB) - added by Simon Willison on 09/14/05 05:15:53.
runtests.py patch.

Change History

09/14/05 05:15:53 changed by Simon Willison

  • attachment runtests-granular.patch added.

runtests.py patch.

09/18/05 20:14:04 changed by adrian

  • status changed from new to assigned.

09/18/05 20:18:13 changed by adrian

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in [646].


Add/Change #506 ([patch] runtests.py should allow models to be tested individually)




Change Properties
Action