title: Python unit test for a function that has try/except
body: <p>I have a function that has try/except as follows:</p>
  
  <pre><code>def func_A():
    try:
         # do some stuff
    except Exception as e:
       log.error("there was an exception %s", str(e))
  </code></pre>
  
  <p>I want to write a unit test for this <code>func_A()</code>
  More importantly, I want to ensure that</p>
  
  <ul>
  <li><strong>No exception was caught inside A</strong></li>
  </ul>
  
  <p>I have <code>try/except</code> just for safety. 
  Unless there is a bug, there should be no exception thrown inside A (although it will be caught with <code>try/except</code>) and that's what I want to validate with my unit test.</p>
  
  <p>What is the best way for unit test to catch the case where there was an exception thrown and caught?</p>