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 conftest.py like this:

@pytest.fixture
def empty_db(django_db_setup):
    pass


@pytest.fixture
def full_db(django_db_setup, django_db_blocker):
    with django_db_blocker.unblock():
         load_json_into_fresh_database("tests/test_fixtures/db_dev.json")


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

@pytest.fixture(params=[1,2])
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.