title: assertRaises fails, even the callable raises the required exception (python, unitest)
body: <p>I have the following test-code checking for an exception raising in a function. I expect the test to pass, but a failure is indicated instead. Here is the test code:</p>
  
  <pre><code>import unittest
  
  # define a user-defined exception
  class MyException(Exception):
      def __str__(self):
          return repr("ERROR: Just raised my exception!")
  
  # this is my main class with a method raising this exception
  class MyMainObject(object):
  
      def func(self):
          raise MyException()
  
  # the test class
  class TestConfig(unittest.TestCase):
  
      def test_1(self):
  
          other = MyMainObject()
          self.assertRaises(MyException, other.func())
  
  # calling the test
  if __name__ == '__main__':    
      unittest.main()
  </code></pre>
  
  <p>When <code>other.func()</code> is called in the assert statement, <code>MyException</code> is raised (can be checked easily). So, the <code>assertRaises</code> test should pass the test, as <code>other.func()</code> failes with <code>MyException</code>, BUT:</p>
  
  <pre><code>....
  MyException: 'ERROR: Just raised my exception!'
  
  ----------------------------------------------------------------------
  Ran 1 test in 0.001s
  
  FAILED (errors=1)
  </code></pre>
  
  <p>I do not see something wrong, so I would appreciate some input on this problem.</p>