pytest-django reusedb option applied for several fixtures

Hi all,

Today I am working with importing data files with a script that should add data if it is missing, or update it if there is a match on a unique field (e.g. username) or unique_together fields (e.g. contenttype). I have been able to create a pytest database fixture set in like this:

def empty_db(django_db_setup):

def full_db(django_db_setup, django_db_blocker):
    with django_db_blocker.unblock():

def db_conditions():
    """Mapping of possible database conditions as fixtures"""
    return {1: empty_db, 2: full_db}

def db_condition(request, db_conditions):
    return db_conditions[request.param]

I would like the --reusedb option to keep both conditions of the db fixture in memory, instead of taking a minute or two per test to recreate the ‘full_db’ fixture. A few versions ago, I was just using a full fixture, and calling that the db.