Hi,

What's the best way to bundle tests into a test archive for a distribution 
using distribute or setuptools?

My requirements:
* Tests should not be installed because the testsuite is larger than the actual 
package and not generally usefull
* "python setup.py develop" should also not add the testsuite to sys.path
* Some tests use extensions that are part of the testsuite
* It should be possible to use "python setup.py test" to run the testsuite 

My current directory layout is simular to the CPython tree:

* toplevel setup.py script
* Lib/ contains modules/packages
* Modules/ contains extension source
* TestSuite/ contains the unittests

The setup.py file contains a package_dir declaration:

    package_dir = { '': 'Lib', 'TestSuite': 'TestSuite' },

I also have a custom build_ext command to ensure that extensions in the 
testsuite get copied there during the build phase
(as if the inplace option is selected for just those extensions).

This works but feels rather fragile, and I wonder if there is a cleaner 
solution for meeting my requirements.

(I'm using plain unittest for the tests and will probably switch to unittest2 
in the near future)

Ronald


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to