title: Make multiple @pytest.mark.parametrize with pytest
body: <p>I was looking for how to make a double <code>@pytest.mark.parametrize</code>.</p>
  <p>This wrapper has a great advantage because it allows you to test an assert on a parameter and move to the next parameters if it is false.</p>
  <p>I would like to make a double <code>@pytest.mark.parametrize</code> to compare two tables:</p>
  <pre class="lang-py prettyprint-override"><code>excepted = {&quot;Parametre 1&quot;:{&quot;Objet 1&quot;:&quot;Yes&quot;,&quot;Objet 2&quot;:&quot;Yes&quot;,&quot;Objet 3&quot;:&quot;Yes&quot;},&quot;Parametre 2&quot;:{&quot;Objet 1&quot;:&quot;No&quot;,&quot;Objet 2&quot;:&quot;Yes&quot;,&quot;Objet 3&quot;:&quot;Yes&quot;}}
  obtained = {&quot;Parametre 1&quot;:{&quot;Objet 1&quot;:&quot;Non&quot;,&quot;Objet 2&quot;:&quot;Yes&quot;,&quot;Objet 3&quot;:&quot;Yes&quot;},&quot;Parametre 2&quot;:{&quot;Objet 1&quot;:&quot;No&quot;,&quot;Objet 2&quot;:&quot;Yes&quot;,&quot;Objet 3&quot;:&quot;Yes&quot;}}
  </code></pre>
  <p><a href="https://i.stack.imgur.com/O3OPh.png" rel="nofollow noreferrer">my tables : </a></p>
  <pre><code>excepted : 
           Parametre 1 Parametre 2
  Objet 1         Yes          No
  Objet 2         Yes         Yes
  Objet 3         Yes         Yes
  
  obtained : 
           Parametre 1 Parametre 2
  Objet 1         Non          No
  Objet 2         Yes         Yes
  Objet 3         Yes         Yes
  </code></pre>
  <ul>
  <li>for each object:
  <ul>
  <li>test all columns.</li>
  </ul>
  </li>
  </ul>
  <p>Like the following method:</p>
  <pre class="lang-py prettyprint-override"><code>import pytest
  import pandas as pd
  @pytest.mark.parametrize(&quot;objet&quot;, ['Objet 1', 'Objet 2', 'Objet 3'])
  def object_test(objet: str):
      obtained = pd.DataFrame(obtained)
      assert objet in obtained.index.values
      excepted = pd.DataFrame(excepted)
      for column in results.columns:
          obtained_cell = obtained.loc[objet][column]
          excepted_cell = excepted.loc[objet][column]
          test_cell(objet, obtained_cell, excepted_cell)
  
  
  def test_cell(object_name, obtained_cell, excepted_cell):
      if excepted_cell  == 'Yes':
          assert obtained_cell == excepted_cell, f&quot;{object_name}&quot;
      else:
      if obtained_cell == 'Yes':
          warnings.warn(UserWarning(f&quot;bad annotation&quot;))
  </code></pre>
  <p>I would add above <code>test_cell</code></p>
  <pre class="lang-py prettyprint-override"><code>@pytest.mark.parametrize([&quot;object_name, obtained_cell, excepted_cell&quot;], object_test())
  def test_cell(object_name, obtained_cell, excepted_cell):
  
  </code></pre>
  <p>But I can't because I have to specify value object for my function</p>