@pytest.fixture
def thing(request, db):


    class ThingFactory(object):

        def get(self):
            thing = MyModel.objects.create()
request.addfinalizer(thing.delete)
return thing
return ThingFactory()

def test_thing(thing):
    thing1 = thing.get()
thing2 = thing.get()
Multiple copies of a py.test fixture