On Thu, Jun 14, 2012 at 6:51 PM, Anssi Kääriäinen
<anssi.kaariai...@thl.fi> wrote:
> On 14 kesä, 13:35, Chris Wilson <ch...@aptivate.org> wrote:
>> I've made some improvements (in my view) to the DjangoTestSuiteRunner. I
>> got tired of having to remember my test class names and of typing so much:
>>
>>   ./manage.py test binder.BinderTest.test_can_create_users
>>
>> This new version searches for tests with the given name in all
>> INSTALLED_APPS, so you can just type this:
>>
>>   ./manage.py test test_can_create_users
>
> A big +1 to easier running of single tests. I haven't checked the
> implementation / API details at all. But I do know I would have
> immediate use for this feature in running Django's tests.

Well, sure -- easier is better -- but is this actually going to be
easier? Are you saying that you've never written two test classes with
the same test name? Just looking at code I've got right now -- I've
got a dozen tests named "test_bad_date" scattered throughout my test
suite. How do I disambiguate between them?

We already have a problem with namespace collapsing -- if you have two
test classes with the same name in an app, you can't differentiate
between them. I'd rather not compound the problem by removing class
names from the discovery process as well.

Although I'm not a big fan of Nose for testing, this is one thing I
think they've got right -- explicit path naming of tests, not trying
to collapse namespaces in order to make it "easier".

> Another feature which I would find useful would be "--log-failed-
> cases=somefile". Then you could re-run the failed tests using:
>
>    ./manage.py test < somefile
>
> I would find this very useful in fixing regressions - run the full
> test suite - fix regressions - try to run the failed cases - fix more
> - run the failed cases again - when done rerun full test suite.
>
> Anybody else for this feature?

Bikeshedding, I'd rather just have a single flag that:
 * logs to a known location
 * searches for the existence of the log when the test run starts; if
the log exists, only run the failed tests
 * if the test suite passes without error, deletes the log so that the
next test run executes everything.

However, +1 to the general idea. "Run the tests that just failed" is a
very common use case for me; it would be nice to have interface
support for it.

Russ %-)

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

Reply via email to