[Python-Dev] Adding test case methods to TestCase subclasses

Ethan Furman ethan at stoneleaf.us
Sat Apr 16 05:44:53 CEST 2011


Ben Finney wrote:
> Both interesting, thank you. But Python 3 isn't an option for several
> projects where I'd like to use this.

Okay, I took some time to try and figure this out (have I mentioned how 
much I love Python 3's clean-up?), and I have something -- lightly 
tested with methods, properties, and attributes, with the objects being 
kept in classes instead of modules.

Posted to ActiveState.
http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit

Hope this helps!

~Ethan~


More information about the Python-Dev mailing list