[TIP] Running tests

Marius Gedminas marius at gedmin.as
Wed May 6 13:24:41 PDT 2009


On Wed, May 06, 2009 at 11:16:43AM -0700, C. Titus Brown wrote:
> How do you all run your tests?  And is there a Python-wide standard
> anywhere for how to run them?

bin/test [arguments]

Sometimes it's a zc.buildout-created Python script that sets up sys.path
correctly and invokes the real test runner (e.g.
zope.testing.testrunner).  Sometimes it's a shell script that runs, e.g.
nosetest with the appropriate extra command line options (rarely needed)
or sets $PYTHONPATH (likewise) or runs it from the local development
virtualenv that has all the necessary packages.

I also like to have bin/run for starting the web server (if the project
is a web app), or bin/$whatever if the project is a command line tool.

I also try to make 'python setup.py test' work, if it's not too hard.

> I know 'python setup.py test' is a semi-standard under setuptools, but
> it only works with unittest and nose.

I've heard that some people have had success making it work with
zope.testing as well.

Marius Gedminas
-- 
If I open a closet and there's a box in it and I have no idea what is in the
box because I have not opened it since 1996, I will strongly take under
consideration the possibility of contemplating a general study of the
feasibility of chucking the box or at least moving it to one side.
        -- James Nicoll's Box Rule
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090506/42cc794c/attachment.pgp 


More information about the testing-in-python mailing list