#4460 - Running individual tests in a test suite

13 views
Skip to first unread message

Russell Keith-Magee

unread,
Jul 24, 2007, 10:21:58 AM7/24/07
to Django Developers
Hi all,

I've just uploaded a patch to #4460 which adds the ability to start
individual tests or test cases from a test suite. Using this patch,
./manage.py test and ./runtests.py gain the ability to do the
following:

# run all tests in the project
./manage.py test

# run all tests in myapp
./manage.py test myapp

# run all the tests in the Foo TestCase contained in myapp
./manage.oy test myapp.Foo

# run the test_bar test in the Foo TestCase
./manage.py test myapp.Foo.test_bar

Other than adding the ability to invoke individual tests, this will
has no effect on most end users.

However, it does require a significant change to the prototype of
run_test, which will be backwards incompatible for anyone with a
customized test runner. Previously, run_tests accepted a list of
application modules; run_tests now takes a list of test labels, and it
is the responsibility of the test runner to load the appropriate apps.
Anyone with a customized test runner will need to incorporate module
loading code as part of their test runner.

This change won't affect most users, and it isn't difficult to make
the change for those users that will be affected (sample logic for an
implementation exists in the Django default test runner).

Are there any objections to making this change?

Yours,
Russ Magee %-)

Ivan Sagalaev

unread,
Jul 24, 2007, 11:00:53 AM7/24/07
to django-d...@googlegroups.com
Russell Keith-Magee wrote:
> Hi all,
>
> I've just uploaded a patch to #4460 which adds the ability to start
> individual tests or test cases from a test suite.

Wow, this is handy! Looking forward for commit!

Jacob Kaplan-Moss

unread,
Jul 24, 2007, 1:49:07 PM7/24/07
to django-d...@googlegroups.com
On 7/24/07, Russell Keith-Magee <freakb...@gmail.com> wrote:
> I've just uploaded a patch to #4460 which adds the ability to start
> individual tests or test cases from a test suite.

Woo!

> Are there any objections to making this change?

None whatsoever -- I can't wait to use this.

Jacob

Chris Heisel

unread,
Jul 24, 2007, 8:18:20 PM7/24/07
to django-d...@googlegroups.com
Can't wait to see it!

Adrian Holovaty

unread,
Jul 27, 2007, 11:46:34 PM7/27/07
to django-d...@googlegroups.com
On 7/24/07, Russell Keith-Magee <freakb...@gmail.com> wrote:
> Are there any objections to making this change?

Go for it!

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

Russell Keith-Magee

unread,
Jul 28, 2007, 12:11:56 AM7/28/07
to django-d...@googlegroups.com
On 7/28/07, Adrian Holovaty <holo...@gmail.com> wrote:
>
> On 7/24/07, Russell Keith-Magee <freakb...@gmail.com> wrote:
> > Are there any objections to making this change?
>
> Go for it!

Cheers. Committed as #5769.

Russ %-)

Reply all
Reply to author
Forward
0 new messages