[Distutils] Distutils suggestion - test action

Moore, Paul Paul.Moore@uk.origin-it.com
Wed Feb 28 05:09:00 2001


Following on from my message about "CPAN", I was thinking that one extremely
useful addition to distutils would be to add a "test" action. The basic
approach would be that

    python setup.py test

would run a test suite. Of course, for this to work, it would require
modules to put tests in "a standard place". There are two main options - the
first is for modules to have tests inline, via if __name__=="__main__".
While this is common, I would suggest instead that running a separate
test.py would be better. There's nothing stopping the developer having
inline tests, it just means that test.py becomes a simple wrapper
(execfile("module.py")).

If test.py does not exist, distutils should print a simple message "No tests
defined".

Do people think this is a good idea? I would be willing to look into
implementing this, although I have no experience in hacking distutils.

Paul.