[TIP] subclassing TestSuite to override __iter__ is painful

Olemis Lang olemis at gmail.com
Mon Apr 6 06:48:27 PDT 2009

On Sat, Apr 4, 2009 at 5:03 PM, Robert Collins
<robertc at robertcollins.net> wrote:
> I've put a patch up here http://bugs.python.org/issue5693. In short, a
> TestSuite whose __iter__ does something more complex (such as test
> discover) requires you to reimplement nearly everything rather than just
> __iter__ and addTest. This makes it a lot simpler.

Didnt see the patch but AFAIK ... test suites are there only to group
test cases ... not to perform test discovery (that's loaders business

I see there are strong influences in order to change XUnit paradigm in
Python. Pls, I beg you ... if you are going to improve the lib, at
least keep the spirit and the foundations of the original framework.
XUnit has been stable and widely adopted because of its well-known
stability due to the separation of concerns and the clear roles
performed by its classes considering the patterns involved. If we |
you | they obviate that, then pls that's not XUnit ... IMHO ...

Pls, keep things as simple as possible, keep classes as dummy as
possible, retain the separation of concerns established by XUnit since
many years ago. The real value of classes comes when they 'r put
together, and synergies show up ... ;)

CMIIW ... anyway ... maybe I'm wrong, but TestSuite(s) should group
test cases, and nothing beyond that ... If complex groupings are
needed (e.g. dutest.DocTestSuite), pls, write a separate subclass, and
that's it ...

This is IMHO ... ;)



Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

More information about the testing-in-python mailing list