title: How can I parametrize tests to run with different fixtures in pytest?
body: <p>From the pytest <a href="https://docs.pytest.org/en/latest/parametrize.html" rel="noreferrer">documentation</a>:</p>
  
  <blockquote>
    <p>@pytest.mark.parametrize allows one to define multiple sets of arguments and fixtures at the test function or class.</p>
  </blockquote>
  
  <p>It looks like this means that <code>pytest.mark.parametrize</code> can mark a test to run with <em>multiple sets of fixtures</em>? I can find plenty examples of parametrizing arguments, but I can't figure out how to parametrize different sets of fixtures.</p>
  
  <p>I think <a href="https://stackoverflow.com/a/46420704/512652">this answer</a> comes close, but that's really just parametrizing arguments, then resolving the different fixtures in the test body.</p>
  
  <p>Is it possible to mark a test to run multiple times, using different sets of fixtures?</p>
  
  <hr>
  
  <p>Note I'm trying to do something like this:</p>
  
  <pre><code>import pytest
  
  # some data fixutres
  @pytest.fixture()
  def data1():
      """Create some data"""
  
  @pytest.fixture()
  def data2():
      """Create some different data"""
  
  @pytest.fixture()
  def data3():
      """Create yet different data"""
  
  
  # The tests
  @pytest.mark.parametrize('data', [data1, data2])
  def test_foo(data):
      """Test something that makes sense with datasets 1 and 2"""
  
  @pytest.mark.parametrize('data', [data2, data3])
  def test_bar(data):
      """Test something that makes sense with datasets 2 and 3"""
  </code></pre>