Ethan Furman <et...@stoneleaf.us> writes: > Ben Finney wrote: > > 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's ‘unittest’? > > Metaclasses, if's that an option... […] > or a class decorator […]
Both interesting, thank you. But Python 3 isn't an option for several projects where I'd like to use this. -- \ “What is needed is not the will to believe but the will to find | `\ out, which is the exact opposite.” —Bertrand Russell, _Free | _o__) Thought and Official Propaganda_, 1928 | 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