Reuse function as pytest fixture
I have a function in my code that is being used by fastapi to provide a db session to the endpoints: def get_db() -> Generator[Session, None, None]: try: db = SessionLocal() yield db finally: db.close() I want to use the same function as a pytest fixture. If I do something like the following, the fixture… Read More Reuse function as pytest fixture