title: Multiple copies of a pytest fixture
body: <p>Let's say I have a simple fixture like the following (using pytest-django, but it applies to pytest as well):</p>
  
  <pre><code>@pytest.fixture
  def my_thing(request, db):
      thing = MyModel.objects.create()
      request.addfinalizer(lambda: thing.delete())
      return thing
  </code></pre>
  
  <p>This works great when my tests need a single instance of MyModel. But what about if I need two (or three or four)? I want each instance to be distinct, but to be set up in the same way.</p>
  
  <p>I could copy/paste the code and rename the fixture function, but that seems inelegant.</p>
  
  <p>Similarly, I have tried:</p>
  
  <pre><code>@pytest.fixture
  def my_thing_1(my_thing):
      return my_thing
  
  @pytest.fixture
  def my_thing_2(my_thing):
      return my_thing
  </code></pre>
  
  <p>However, each of these appears to return the same instance of MyModel.</p>
  
  <p>Is there a way to do what I want using pytest's built-in functionality? Alternately, I could move the setup/teardown of my fixture out into helper functions so I'm not duplicating too much code.</p>
  
  <p>Or am I going about this whole thing the wrong way?</p>