title: Python unit test with base and sub class
body: <p>I currently have a few unit tests which share a common set of tests.  Here's an example:</p>
  
  <pre><code>import unittest
  
  class BaseTest(unittest.TestCase):
  
      def testCommon(self):
          print 'Calling BaseTest:testCommon'
          value = 5
          self.assertEquals(value, 5)
  
  class SubTest1(BaseTest):
  
      def testSub1(self):
          print 'Calling SubTest1:testSub1'
          sub = 3
          self.assertEquals(sub, 3)
  
  
  class SubTest2(BaseTest):
  
      def testSub2(self):
          print 'Calling SubTest2:testSub2'
          sub = 4
          self.assertEquals(sub, 4)
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>The output of the above is:</p>
  
  <pre><code>Calling BaseTest:testCommon
  .Calling BaseTest:testCommon
  .Calling SubTest1:testSub1
  .Calling BaseTest:testCommon
  .Calling SubTest2:testSub2
  .
  ----------------------------------------------------------------------
  Ran 5 tests in 0.000s
  
  OK
  </code></pre>
  
  <p>Is there a way to rewrite the above so that the very first <code>testCommon</code> is not called?</p>
  
  <p><strong>EDIT:</strong>
  Instead of running 5 tests above, I want it to run only 4 tests, 2 from the SubTest1 and another 2 from SubTest2. It seems that Python unittest is running the original BaseTest on its own and I need a mechanism to prevent that from happening.</p>