title: How use Python unittest to test a class hierarchy?
body: <p>given a Python class hierarchy, say</p>
  
  <pre><code>class Base:
      def method1
      def method2
      def method3
      ...
  class Derived1(Base)
  class Derived2(Base)
  </code></pre>
  
  <p>etc.</p>
  
  <p>and given that Base defines some common interface which is re-implemented differently in each Derived class.
  What would be the most straightforward way to unit test all member functions of all classes.
  Since i'm having a class hierarchy, i thought of doing something like...</p>
  
  <pre><code>class MyTestCase(unittest.TestCase):
      def testMethod1:
          ## Just as an example. Can be similar
          self.failUnless(self.instance.method1())
      def testMethod2
      ...
  </code></pre>
  
  <p>And then setting up the test suite with test cases for different instantiations of the class hierarchy
  But how do i get the "instance" parameter into the MyTestCase class?</p>