mirror of https://github.com/tiangolo/fastapi.git
fix(tests): Dispose SQLAlchemy engine in client fixture teardown
This commit is contained in:
parent
8e62206a78
commit
318e73a301
|
|
@ -47,6 +47,8 @@ def get_client(request: pytest.FixtureRequest):
|
|||
with TestClient(mod.app) as c:
|
||||
yield c
|
||||
|
||||
mod.engine.dispose()
|
||||
|
||||
|
||||
def test_crud_app(client: TestClient):
|
||||
# TODO: this warns that SQLModel.from_orm is deprecated in Pydantic v1, refactor
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ def get_client(request: pytest.FixtureRequest):
|
|||
with TestClient(mod.app) as c:
|
||||
yield c
|
||||
|
||||
mod.engine.dispose()
|
||||
|
||||
|
||||
def test_crud_app(client: TestClient):
|
||||
# TODO: this warns that SQLModel.from_orm is deprecated in Pydantic v1, refactor
|
||||
|
|
|
|||
Loading…
Reference in New Issue