[Tutor] directory structure with tests?

Cameron Simpson cs at cskk.id.au
Wed Mar 6 18:57:09 EST 2019


On 06Mar2019 23:41, Alan Gauld <alan.gauld at yahoo.co.uk> wrote:
>On 06/03/2019 22:38, Mats Wichmann wrote:
>> "It depends".
>...
>> How's that for a definitive answer?  :)
>
>Pretty good! and I agree with all of it :-)
>
>Although  personally I always use a test subdirectory
>and then, for building a distributable, use a file
>filter (eg find in *nix) to prune those out.
>All version controlled of course!

There are those who argue that it is better to include the test files in 
the distribution. Aside from transparency and completeness, it may also 
aid bug reports as a test might only fail in the end user's environment 
and not that of the developer. Being able to get the error output from 
the end user running the tests is a win there.

Q: How many user support people does it take to change a light bulb?
A: We have an exact copy of the light bulb here and it seems to be
   working fine.  Can you tell me what kind of system you have?

For variety, in my own code I keep the tests for foo.py in foo_tests.py, 
the better to be seen next to foo.py in listings and file completion.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list