AsyncGenerator instead of AsyncSession in pytest, but why
I have fixtures
AsyncGenerator instead of AsyncSession in pytest, but why
I have fixtures
How can I make Pytester reuse plugins?
I am trying to test fixtures that I have setup in my testing repository.
Fixture not clearing database before each test
I am writing tests for a FastAPI application using httpx and pytest-asyncio. I want to ensure that the MongoDB database is cleared before each test method. However, despite setting up the fixture with scope="function"
and autouse=True
, it seems that the database is not being cleared before each test.
Issue with pytest-asyncio Fixture Not Clearing Database Before Each Test in FastAPI Application
I am writing tests for a FastAPI application using httpx and pytest-asyncio. I want to ensure that the MongoDB database is cleared before each test method. However, despite setting up the fixture with scope="function"
and autouse=True
, it seems that the database is not being cleared before each test.