[Grok-dev] Re: where do I put doctests for my models?

Martijn Faassen faassen at startifact.com
Tue Aug 7 14:21:43 EDT 2007


Brandon Craig Rhodes wrote:
[snip discussion about what the appropriate level of magic is]

I agree that some automation for tests would be useful.

> The rule that "./bin/test runs, as a doctest, every .txt file that it
> can find under your app/ directory" would be, to me, exactly the same
> kind of magic that Grok already provides for modules.  It would
> confuse me - in fact, it did confuse me! - when the first .txt files I
> added to my application were not auto-discovered by "./bin/test",
> because I had assumed that everything in Grok would follow the same
> rule: a recursive descent of my modules directories, looking for
> things to process.

Unless we can find a way to contain within the .txt file instructions on 
the testing strategy to take (unit test, functional test, what values to 
set up in a glob, etc), just picking up .txt files seems a bit too 
aggressive to me. In particular setting up global names to use in the 
doctest is quite common and somewhat difficult to do from within the 
doctest itself. See my other reply for an idea of what I was considering 
myself.

Regards,

Martijn



More information about the Grok-dev mailing list