title: Wrapping unittest TestCases in Python
body: <p>Hi I'm trying to tweak Python's standard unittest library to my own needs.
  So far everything is experimental and I want to know if I'm doing something wrong, so here is my code:</p>
  
  <pre><code>class Should(object):
      def __init__(self, subject):
          self.subject = subject
          self.suite = unittest.TestSuite()
  
      def run(self):
          unittest.TextTestResult().run(self.suite)
  
      def contain(self, elem):
          subject = self.subject
          class Contain(unittest.TestCase):
              def test_contain(self):
                  self.assertIn(elem, subject)
          self.suite.addTest(Contain('test_contain'))
  
  should = Should([1, 2, 3])
  should.contain(1)
  should.run()
  </code></pre>
  
  <p>If I run this piece of code I get the following error:</p>
  
  <pre><code>unittest.TextTestResult().run(self.suite)
  TypeError: __init__() takes exactly 4 arguments (2 given)
  </code></pre>
  
  <p>According to what I've read from the unittest documentation the line <code>unittest.TextTestResult().run(self.suite)</code> should run the test cases on the suite.</p>
  
  <p>Am I doing something wrong or it's just that the way I'm wrapping the test cases is not viable.</p>
  
  <p>Thanks in advance.</p>