[TIP] Defining a convention for running tests, #2

Robert Collins robertc at robertcollins.net
Sat Feb 27 12:33:25 PST 2010


On Sat, 2010-02-27 at 20:18 +0000, Michael Foord wrote:


> My *understanding* (and apparently confirmed by Philipp Eby's
> response) is that test_suite in setuptools specifies a suite and not a
> callable.

That surprises me. Here's what the nose folk think it does:
"Setuptools has a feature that allows you to run the tests in a
distribution by invoking the distribution's "setup.py" script with a
"test" argument. As long as the argument's to "setup" within that script
contains a "test_suite" parameter which resolves to a module, a package,
or a function which returns a unittest TestSuite, it will invoke a
unittest TestLoader subclass to find the tests within the distribution;
it will then subsquently run them. For instance:"
[http://plope.com/Members/chrism/nose_setup_py_test]

This thread from a couple years back is interesting
http://www.mail-archive.com/distutils-sig@python.org/msg02732.html

http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/ also thinks that test_suite in setup() can be the name of a callable to return the suite.

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100228/f100bba9/attachment.pgp>


More information about the testing-in-python mailing list