<br><br><div class="gmail_quote">On 7 June 2010 22:43, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org">barry@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hey guys, I have a few quick questions about unittest2. Apologies if these<br>
have been discussed before.<br>
<br>
Distribute adds the ability to run 'python setup.py test' by including the<br>
`test_suite` keyword to your setup(). What's the best way to integrate<br>
unittest2 and distribute to enable the former to do test discovery when run<br>
via the setup.py?<br>
<br></blockquote><div><br><br>Note that I have now implemented a setuptools compatible test collector for unittest2. <br><br> <a href="http://hg.python.org/unittest2/file/11200ca25af1/unittest2/collector.py">http://hg.python.org/unittest2/file/11200ca25af1/unittest2/collector.py</a><br>
<br>As you can see it is very simple... :-) It will be in version 0.5.0 of unittest2.<br><br>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. <br>
<br>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.<br><br>All the best,<br>
<br>Michael Foord<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
`python setup.py test` supports a -m and -s option to filter (minimally) the<br>
tests that are run. Can unittest2's richer command line options be supported?<br>
(This may be more of a distutils/setuptools/distribute question.)<br>
<br>
unit2 -p takes shell globs, but I really like zope.testrunner's regexp-based<br>
filters. Any chance unittest2 will support something like that? One of the<br>
reasons I like zope's test discovery is because it works much better with<br>
doctests. E.g. I can do (after a buildout):<br>
<br>
% bin/test -vv -t using<br>
<br>
and it will only run my using.txt doctest. Note that I have a test_docs.py<br>
module that does individual .txt doctest discovery, wrapping each one in a<br>
DocFileSuite with appropriate optionflags, and setUp. IWBNI unittest2<br>
eventually grew better support for doctests.<br>
<br>
Is it intentional that a module's load_tests() not called when unit2 -p is<br>
used?<br>
<br>
Cheers,<br>
<font color="#888888">-Barry<br>
</font><br>_______________________________________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.voidspace.org.uk">http://www.voidspace.org.uk</a><br><br><br>