title: How to assert that a function call does not return an error with unittest?
body: <p>Is there anyway with unittest to just assert that a function call does not result in an error, whether it is a TypeError, IOError, etc.</p>
  
  <p>example:</p>
  
  <pre><code>assert function(a,b) is not error
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if not assertRaises function(a, b)
  </code></pre>
  
  <p>What is the best way to do this (without using classes)?  The trouble I'm having is all the useful documentation I come a cross in unittest is all class based and I don't want to use class based.</p>
  
  <p>Full example:</p>
  
  <pre><code>def test_validate_params():
      assert test.validate_params('hackenv-re', 'test.username') is not errors
      assert test.validate_params('fakeenv', 'test.username') is error
      assert test.validate_params('hackevn-re', 'vagrant') is error
      counter += 1
      print "Test Passed {0}/5: validate_params".format(counter)
  </code></pre>