Opened 19 years ago

Closed 19 years ago

#506 closed enhancement (fixed)

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

Reported by: Simon Willison Owned by: Adrian Holovaty
Component: Tools Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (1)

runtests-granular.patch (6.3 KB ) - added by Simon Willison 19 years ago.
runtests.py patch.

Download all attachments as: .zip

Change History (3)

by Simon Willison, 19 years ago

Attachment: runtests-granular.patch added

runtests.py patch.

comment:1 by Adrian Holovaty, 19 years ago

Status: newassigned

comment:2 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [646].

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