title: In python 3.4.1, how can I assert an error in unittest like this?
body: <p>For example, I define a function like </p>
  
  <pre><code>def f(n): return 1+'1'
  </code></pre>
  
  <p>and in the unittest, I define test_error: </p>
  
  <pre><code>assertRaises(TypeError,f(1))
  </code></pre>
  
  <p>But it just showed that this is a error. But when I define f with no argument like</p>
  
  <pre><code>def f(): return 1+'1'
  </code></pre>
  
  <p>and in unittest </p>
  
  <pre><code>assertRaises(TypeError,f)
  </code></pre>
  
  <p>it worked just fine. Why is that? How can I deal with function with arguments?</p>