Ethan Furman <et...@stoneleaf.us> writes:

> Here we have django's TestCase that does *not* want to call
> unittest2.TestCase (assuming that's not a bug), but it gets called
> anyway because the Mixin3 sibling has it as a base class.  So does
> this mean that TestCase and Mixin3 just don't play well together?
>
> Maybe composition instead of inheritance is the answer (in this case,
> anyway ;).

TestCase subclasses is a multiple-inheritance use case that I share. The
mix-ins add test cases (methods named ‘test_’ on the mix-in class) to
the TestCase subclass. I would prefer not to use multiple inheritance
for this if it can be achieved in a better way.

How can composition add test cases detectable by Python 2's ‘unittest’
and Python 3's ‘unittest2’?

-- 
 \         “The userbase for strong cryptography declines by half with |
  `\      every additional keystroke or mouseclick required to make it |
_o__)                                             work.” —Carl Ellison |
Ben Finney

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to