title: Python unittest - setUpClass() is giving me trouble - why can't I inherit like this?
body: <p>I have unittest code like the following:</p>
  
  <pre><code>import unittest
  
  class MyUnitTest(unittest.TestCase):
      def setUpClass(self):
          do_something_expensive_for_all_sets_of_tests()
  
  class MyFirstSetOfTests(MyUnitTest):
      def setUpClass(self):
          super(MyFirstSetOfTests, self).setUpClass()
          do_something_expensive_for_just_these_first_tests()
  
      def test_one(self):
          ...
  
      def test_two(self):
          ...
  
  class MySecondSetOfTests(MyUnitTest):
      def setUpClass(self):
          super(MySecondSetOfTests, self).setUpClass()
          do_something_expensive_for_just_these_second_tests()
  
      def test_one(self):
          ...
  
      def test_two(self):
          ...
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>When I try to run this code, I get an error like this:</p>
  
  <pre><code>======================================================================
  ERROR: setUpClass (__main__.MyFirstSetOfTests)
  ----------------------------------------------------------------------
  TypeError: unbound method setUpClass() must be called with MyFirstSetOfTests instance as first argument (got nothing instead)
  
  ----------------------------------------------------------------------
  </code></pre>