title: Python unittest testcase on catching error failing
body: <p>So I have class Dog:</p>
  
  <pre><code>class Dog:
  
  def __init__(self, res):
      self._res = res
  
  
  def error(self):
      raise IndexError
  </code></pre>
  
  <p>and unit test:</p>
  
  <pre><code>class TestDog(unittest.TestCase):
  
  def setUp(self):
      self.dog = Dog([1,2])
  
  def testError(self):
      self.assertRaises(IndexError, self.dog.error())
  </code></pre>
  
  <p>Why is the testcase testError failing? self.dog.error() should result in IndexError being rasied, and I believe the assertRaises is correctly formatted.</p>
  
  <p>Any help is appreciated, thanks.</p>