[TIP] unittest2, distribute, and doctests

Barry Warsaw barry at python.org
Thu Jun 10 11:19:01 PDT 2010


On Jun 10, 2010, at 01:21 PM, Michael Foord wrote:

>On 7 June 2010 22:43, Barry Warsaw <barry at python.org> wrote:
>
>> Distribute adds the ability to run 'python setup.py test' by including the
>> `test_suite` keyword to your setup().  What's the best way to integrate
>> unittest2 and distribute to enable the former to do test discovery when run
>> via the setup.py?
>>
>>
>
>Note that I have now implemented a setuptools compatible test collector for
>unittest2.
>
>    http://hg.python.org/unittest2/file/11200ca25af1/unittest2/collector.py

Ha!  That looks exactly like what I managed to hack together after my last
email.  :)

>As you can see it is very simple... :-) It will be in version 0.5.0 of
>unittest2.

Nice, thanks.

>If you specify "test_suite = 'unittest2.collector'" in your setup.py, then
>the distribute / setuptools test command (setup.py test) launches test
>discovery (with the default parameters) from the current directory.
>
>As it isn't configurable (making unittest2 extensible and configurable on a
>per project basis is a task for after Python 2.7 is released) it is perhaps
>most useful at the moment as an example.

It's the right direction, thanks.  I'll try grabbing the trunk and will check
it out in a virtualenv.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100610/2d87a95a/attachment.pgp>


More information about the testing-in-python mailing list