title: How to parametrize a test, taking the parameters from a parametrized fixture?
body: <p>I apologize in advance for repeating the word parameter 1000 times. My use case is as follows. </p>
  
  <p>I'm using <strong>pytest</strong> to test a parser that parses fields out of product pages from an online shop. </p>
  
  <p>I have parametrized a fixture, so that each fixture imports data for one product. By data, I mean the HTML source code and a list of fields with their expected values. Down the line I have a parametrized test that takes a list of tuples (<em>field</em>, <em>expected value</em>), so that each field gets its own test. </p>
  
  <p>Basically, the "bare bones" problem would like something like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>from pytest import fixture, mark
  
  products = [
      {
      'text': 'bla bla', 
      'fields': [('bla', 0), ('foo', -1)]
      },
      {
      'text': 'foo bar', 
      'fields': [('bla', -1), ('foo', 0), ('bar', 4)]
      }
  ]
  
  @fixture(params=products)
  def product(request):
      return request.param
  
  
  @mark.parametrize('field_key, field_value', product['fields'])
  def test_parser(product, field_key, field_value):
      assert product['text'].find(field_key) == field_value
  </code></pre>
  
  <p>In the context of the <code>@mark.parametrize</code> decorator, <code>product</code> isn't interpreted as a fixture, so <strong>pytest</strong> returns:</p>
  
  <pre><code>TypeError: 'function' object has no attribute '__getitem__'
  </code></pre>
  
  <p>There's lot of introspection magic going on with <strong>pytest</strong> and I'm having trouble finding a solution. I had a look at <a href="https://stackoverflow.com/questions/33611321/is-it-possible-to-parametrize-a-test-with-fixtures">this question</a> but this is not quite what I want. Is there a way to achieve this? Thanks.</p>