[TIP] [Zope-dev] zope.testrunner and nose count doctests differently
michael at voidspace.org.uk
Mon Nov 7 14:25:44 PST 2011
On 07/11/2011 19:51, Mark Sienkiewicz wrote:
> On 11/07/11 12:53, Chris Withers wrote:
>> The only hiccup is that nose doesn't respect a test_suite function by
>> default, so I wrote a plugin to make it do the right thing:
>> Nose people: any idea *why* nose doesn't respect this method?
> I'm not directly involved in nose development, but since I have seen
> you ask this question a few times and not seen an answer, I'll give
> you my observation:
> The point of nose is to run tests without the complex interface
> required by the original unittest. In this case, it means you never
> need to write a test_suite -- you write your tests with recognizable
> names and the list of tests is constructed automatically.
unittest doesn't *require* you to write a test_suite either - the point
of test_suite is to allow you to *customize* the set of tests that are
collected automatically when a test module is loaded. So if you are
providing a test_suite it is because the default automatic collection
strategy isn't enough for you.
As a feature in unittest(2) it is a new (although it was taken from
another project - zope.testrunner I *think* - so it isn't new per-se),
which is why nose doesn't support it (yet).
All the best,
> It seems to me that the most likely answer to your question is "didn't
> think of it". When using nose, I would never think of providing a
> test_suite -- a big advantage of nose is that you don't have to. So,
> if I were writing nose (I didn't) or a similar tool (I did), I would
> not think of looking for a test_suite. The automatic discovery is
> just too convenient.
> I think you can make a good argument that nose should use the
> test_suite if it is explicitly specified: "Do exactly what the
> programmer said" is usually a good thing, and programmers who don't
> want to deal with the drawbacks of an explicit test_suite should just
> "don't write one".
> Mark S.
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
More information about the testing-in-python