title: How to parametrize different numbers or positions of arguments?
body: <p>For example, say I have two functions:</p>
  <pre class="lang-py prettyprint-override"><code>def func3(a, b, c):
      for var in (a, b, c):
          if var &lt; 0:
              raise ValueError
      pass
  
  
  def func7(a, b, c, d, e, f, g):
      for var in (a, b, c, d, e, f, g):
          if var &lt; 0:
              raise ValueError
      pass
  </code></pre>
  <p>And in my tests, I want to test a set of invalid values at each parameter.  The only way I know of to do this is to write them all out:</p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize('val', [-2, -3, -4.5])
  def test_invalid_param(val):
      with pytest.raises(ValueError):
          func3(val, 0, 0)
      with pytest.raises(ValueError):
          func3(0, val, 0)
      with pytest.raises(ValueError):
          func3(0, 0, val)
      with pytest.raises(ValueError):
          func7(val, 0, 0, 0, 0, 0, 0)
      with pytest.raises(ValueError):
          func7(0, val, 0, 0, 0, 0, 0)
      with pytest.raises(ValueError):
          func7(0, 0, val, 0, 0, 0, 0)
      ...
  
  </code></pre>
  <p>How can I combine these all into one <code>with pytest.raises</code> case?</p>
  <p>If both funcs had the same number of arguments, I could stack this:</p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize('func', [func3, func7])
  </code></pre>
  <p>but they don't.  If they just had different numbers of arguments and I was only testing the first, then I could stack this:</p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize('func, args', [(func3, (0, 0)), 
                                          (func7, (0, 0, 0, 0, 0, 0))])
  </code></pre>
  <p>But that won't work for testing the parametrized value in multiple positions.</p>