[TIP] secondary testing tools

Jamu Kakar jkakar at kakar.ca
Fri May 6 12:05:22 PDT 2011


Hi,

On Fri, May 6, 2011 at 7:42 PM, Éric Araujo <merwok at netwok.org> wrote:
> Le 06/05/2011 12:09, Jamu Kakar a écrit :
>> On Fri, May 6, 2011 at 4:11 AM, Rustom Mody <rustompmody at gmail.com> wrote:
>>>
>>> For running a battery of tests (in good-ol C projects), the Makefile
>>> is often used.
>>>
>>> What is the recommended tool for orchestrating testing in python?
>
> There’s an emerging consensus about using “setup.py test”.  Such a command
> is provided by setuptools, distutils2 (the new standard, which will be
> included in Python 3.3. and released separately for 2.4-3.2), or you can
> write one in ten lines if you want no dependency (I’ll post an example on
> the Python Cookbook later).  The great thing about it is that users don’t
> have to know what testing tools you use, they can just run “setup.py test”.

I guess this is good, but I'm not overly excited by having to add a
setup.py so that I can run my tests.  I tend to avoid setup.py until I
really need it.

>> There are a number of ways to run unit tests in Python.  I like
>> Twisted's trial runner a lot and usually have a Makefile with a check
>> target, like:
>
> Why not “make test”?  Check, lint and test are different actions in my mind:
> test runs the test suite, lint runs code checking tools, and check verifies
> the packaging (it’s a distutils command provided in Python 2.7 and 3.x).

For the same reasons that Fred mentions.  'make check' running the
tests is a long standing tradition.  I guess those of us with a
background in C programming with the Autotools will find this normal
and others will find it arbitrary.

Thanks,
J.



More information about the testing-in-python mailing list