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

2011-04-15 Thread Ethan Furman
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, properti

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

2011-04-15 Thread Ethan Furman
Ethan Furman wrote: Ben Finney wrote: Ethan Furman writes: 8<---test_compose.py--- import unittest ack! There should be an 'import new' here as well. :/ ___ Python-Dev mailing list Python-Dev@python.org

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

2011-04-15 Thread Ethan Furman
Ben Finney wrote: Ethan Furman writes: >> Ben Finney wrote: >>> 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

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

2011-04-15 Thread Ben Finney
Ethan Furman 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 achie

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

2011-04-15 Thread Ethan Furman
Ben Finney wrote: Ethan Furman 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 toget

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

2011-04-15 Thread Éric Araujo
Hi, I just wanted to clear a slight misunderstanding: How can composition add test cases detectable by Python 2's ‘unittest’ and Python 3's ‘unittest2’? The package shipped in the stdlib is named unittest in all Python versions. The codebase that has seen a lot of improvements thanks to Mic

[Python-Dev] Adding test case methods to TestCase subclasses (was: python and super)

2011-04-14 Thread Ben Finney
Ethan Furman 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? > > Mayb