[Pyunit-interest] pyunit command
Brought to you by:
purcell
From: Michal W. (sabren) <sa...@ma...> - 2000-04-27 09:27:33
|
Hey all, I have a suite of python programs and modules, and am trying to standardize my test process.. I was wondering how other people tended to do this, but haven't found much in the way of documentation. For example, here's what I'm currently planning to do: * For every project/module, have a module called test.py (or test/__init__.py ) in the top level directory. * If using a test directory, each submodule will define a test suite named "suite".. * The main test module will define EITHER a test suite named "suite" (fancy that!), OR for more complex modules, a dictionary of named of test suites named "suites", eg suites={"mysuite":submodule.suite} Given standards like the above, it's fairly easy to write a command called pyunit that does an "import test" and runs test.suite or each test in test.suites. This routine could be bundled with PyUnit. Standards also open up the possibility for, say, an automated routine to check out CVS sources for a project, test it, and if everything passes, create a nightly tarball. I'm actually going to be writing the two above scripts, and hope to add them to the main pyunit distribution if other people are willing to adapt a standard location and naming convention (otherwise, they'd get too complex) As far as I can tell, the DistUtils http://www.python.org/sigs/distutils-sig/ don't yet seem to have a standard for testing.. If we can agree on a standard way to name things, then PyUnit has a good chance of becoming the standard way of testing for all pythonland. The easy thing to do would be to add these standards as suggestions in the docs. Whatcha think? Cheers, - Michal ------------------------------------------------------------------------- http://www.manifestation.com/ http://www.linkwatcher.com/metalog/ ------------------------------------------------------------------------- |