title: How to properly use unit-testing's assertRaises() with NoneType objects?
body: <p>I did a simple test case:</p>
  
  <pre><code>def setUp(self):
  
    self.testListNone = None
  
  def testListSlicing(self):
  
    self.assertRaises(TypeError, self.testListNone[:1])
  </code></pre>
  
  <p>and I am expecting test to pass, but I am getting exception:</p>
  
  <pre><code>Traceback (most recent call last):
  
      self.assertRaises(TypeError, self.testListNone[:1])
  
  TypeError: 'NoneType' object is unsubscriptable
  </code></pre>
  
  <p><strong>I thought that assertRaises will pass since TypeError exception will
  be raised?</strong></p>