On Sat, Oct 10, 2009 at 11:41 PM, Tim Chase
<django.us...@tim.thechases.com> wrote:
>
> Currently, I use
>
> t...@rubbish:~/django/trunk/tests$ python runtests.py
> --settings=settings
>
> to execute the core set of tests.  However, it takes quite a
> while (on the order of hours) on my old box.  Is there a way to
> just run tests on the regressions/ subdirectory or even just a
> particular file within?
>
> How do core devs typically make testing a subset faster?

There's no way to say "just run the tests in the regression
directory", but you can use the same tricks that ./manage.py test
allows - that is, you can say:

./runtests.py --settings=xxx query aggregation_regress serializers_regress

and that will just run the query, aggregation_regress and
serializers_regress tests. For unit tests, you can go one step deeper
and narrow this down to a single TestCase, or a single test inside a
test case:

./runtests.py --settings=xxx test_client.ClientTest
./runtests.py --settings=xxx test_client.ClientTest.test_get_view

Following on from this, I personally have a couple of scripts where
I've gathered together subsets of tests that I know have a particular
focus - e.g., the tests that are testing core database functions, the
tests for the form library, tests for the admin, etc. These scripts
are effectively just aliases for calls to runtests.py with a list of
relevant test names. That way, I can easily run a subset of the full
test suite with a single script.

If I'm working on a particular feature, I may produce a custom script
for an even more reduced subset - for example, when I was working on
aggregation, I had a script to just run aggregation,
aggregation_regress, expressions, expressions_regress and query.

Of course, I still run the full test suite before I commit anything,
but these subsets are usually good enough during the development of a
particular feature that I know is "just database" or "just forms".

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to