[TIP] plguins for unittest2?
memedough at gmail.com
Sat Oct 15 05:08:32 PDT 2011
Opinions are obviously subjective so...
py.test is very good and supports junit xml (--junitxml) and cobertura
xml (--cov) output. It has a more complete plugin interface imho
(having written plugins for py.test / nose / unit2) including
customizing test collection, parallel testing and test
nose is also good and supports junit xml (--with-xunit) and cobertura
xml (--with-cov or --with-coverage --with-xcoverage) output.
unit2 is the new stdlib with backports to 2.4. Haven't see the
plugins branch move since Nov 2010 and never released afaik. It has a
junitxml plugin, a testcoverage plugin and I have a unittest2-cov
plugin on bitbucket.
Both py.test and nose (and presumably unit2) collect stdout / stderr
and so hide it by default. Why is this annoying? You see the output
if a test fails.
The test collection is based on naming convention to automatically
find tests which is good imho over manually writing code to add tests
to test suites. Perhaps you need to rename functions and delete the
test suite providing functions or customize the test collection?
Disclaimer, I wrote pytest-cov, nose-cov, unittest2-cov.
On 15 October 2011 20:57, Chris Withers <chris at simplistix.co.uk> wrote:
> Hi All,
> So, I'm looking for a new testrunner.
> - zope.testrunner doesn't support much beyond working well with buildout,
> that I like
> - nose is annoying (hiding stdout by default, discovers way too many tests
> and doesn't respect test-suite providing functions) but does have plugins (I
> *really* want junit xml and cobertura xml output as I *really* want to use
> - I don't know other test runners and want to use something "standard"
> So, I thought I should use unittest2 and it's "discover"... But before that,
> I need to know if it's possible to get junit xml and cobertura xml out of
> it. Looks like the answer's no, which is fine, I'd be up for writing plugins
> to do that... but there lies the rub.
> How do I write plugins for unittest2?
> I see:
> ...but it doesn't look like that's made it into a release.
> So, what do people recommend? Are there plugins for nose that make its test
> discovery "sane"? Will unittest2 plugins be coming to a pypi release any
> time soon?
> Simplistix - Content Management, Batch Processing & Python Consulting
> - http://www.simplistix.co.uk
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
More information about the testing-in-python