Am I missing something? Is there something that wasn't answered by my reply about using mixins?
from unittest import TestCase class SharedTestMixin(object): def test_shared(self): self.assertNotEquals('foo', 'bar') class TestA(TestCase, SharedTestMixin): def test_a(self): self.assertEquals('a', 'a') class TestB(TestCase, SharedTestMixin): def test_b(self): self.assertEquals('b', 'b') $ nosetests test.py -v test_a (test.TestA) ... ok test_shared (test.TestA) ... ok test_b (test.TestB) ... ok test_shared (test.TestB) ... ok ---------------------------------------------------------------------- Ran 4 tests in 0.001s OK This seems to be a clear answer to the problem that solves the original requirements without introducing error-prone, non-obvious solutions.
-- http://mail.python.org/mailman/listinfo/python-list