[Distutils] The 'test' command
M.-A. Lemburg
mal@lemburg.com
Wed Mar 28 08:50:02 2001
Andrew Kuchling wrote:
>
> On Sat, Mar 24, 2001 at 01:14:46AM -0700, Sean Reifschneider wrote:
> >Along with the name, I think that it'll have to have a default stub which
> >does an "exit(0)" (the default test succeeds) so that the lack of a test
> >doesn't show up the same as a test failure.
>
> An open question: what should the 'test' command do? We could adopt
> some convention to automatically locate test scripts automatically
> (all files matching test/*.py, for example), with a
> tests=['dir/test1.py', dir/test2.py'] override to explicitly list test
> scripts and ignore the convention.
I would prefer to have an option which then tells distutils
which files should be run a regression test, e.g. tests=['a.py','b.py'].
> Next, what would it do with the test scripts? In 2.1b2,
> test.test_support.run_unittest() raises TestFailed when a test suite
> fails. Would it be sufficient to execfile() all the test scripts,
> note which ones raise TestFailed, and print a list of failing tests
> (which would come after the output of individual test scripts).
Please don't make any assumptions about the framework behind the
test suites -- not everyone is going to use pyunit for this...
I'd suggest to simply run the scripts defined in the tests
parameter and look at the resulting shell return code (0 - success;
everything else: failure).
--
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Pages: http://www.lemburg.com/python/