Distutils and unit test files

Cédric Lucantis omer at no-log.org
Mon Jun 23 09:59:19 EDT 2008


Le Monday 23 June 2008 15:38:40 Joe Riopel, vous avez écrit :
> Hi,
>
> I am using Distutils to build and distribute some packages. I do write
> unit tests, but I am confused as to where to put them and how to run
> them prior to the package being installed (The modules being tested
> would not be in my sys.path). I would rather not put the test cases in
> the same files as the modules being tested, I want keep them in a sub
> directory of the module, or in a separate "test" directory.
>
> What are some of the strategies for dealing with this?
>

Yes a checksuite should be kept separate from the 'real' code. You can run it 
locally by setting the PYTHONPATH environment variable :

PYTHONPATH=/path/to/your/modules python checksuite.py

-- 
Cédric Lucantis



More information about the Python-list mailing list