title: Is there a way to test every function call permutation including default params?
body: <p>Assuming I have a function like this: <code>def foo(a, b)</code>, I can test its call with:</p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize(&quot;a&quot;, [1,2,3])
  @pytest.mark.parametrize(&quot;b&quot;, [1,2,3])
  def test_foo(a, b):
      foo(a, b)
  </code></pre>
  <p>However, having a default param complicates it a bit. If I change the function into <code>def foo(a, *,  b=0)</code>, testing it gets complicated:</p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize(&quot;a&quot;, [1,2,3])
  @pytest.mark.parametrize(&quot;b&quot;, [1,2,3])
  def test_foo(a, b):
      foo(a, b=b)
  </code></pre>
  <p>but I also want to verify the default param for <code>b</code> works, i.e. test the call <code>foo(a)</code>. Is it possible to tweak this test in a nice way so it would also test it?</p>
  <p>My only thought is something like this:</p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize(&quot;a&quot;, [1,2,3])
  @pytest.mark.parametrize(&quot;b&quot;, [1,2,3,None])
  def test_foo(a, b):
      if b:
          foo(a, b=b)
      else:
          foo(a)
  </code></pre>
  <p>or split this into multiple tests, but it looks silly and non-elegant. Any better solutions?</p>