Skip to content

Instantly share code, notes, and snippets.

@codemation
Created November 15, 2021 13:02
Show Gist options
  • Save codemation/d44859e2ecd0b2ed418a0af3198ceb5a to your computer and use it in GitHub Desktop.
Save codemation/d44859e2ecd0b2ed418a0af3198ceb5a to your computer and use it in GitHub Desktop.
pydbantic_db_fixture.py
@pytest.mark.asyncio
@pytest.fixture(params=[DB_URL])
async def database_with_cache(request):
db = await Database.create(
request.param,
tables=[Employee],
cache_enabled=True,
testing=True
)
yield db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment