title: PyTest: test which function was called in the if statement
body: <p>I have a function, which considers three different cases and for each case calls a different function, like in the example below</p>
  
  <pre><code>def my_fun(input):
   if input == 1:
      fun1()
   if input == 2:
      fun2()
   if input == 3:
      fun3()
  </code></pre>
  
  <p>I would like to write a test for function <code>my_fun</code> using <code>py.test</code>, but I don't know how I can test if the proper function was called for a given input?</p>