Skip to content

Commit

Permalink
✅ Update tests to check for deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Dec 4, 2023
1 parent 3b2f955 commit 5f4d502
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_query.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Optional

import pytest
from sqlmodel import Field, Session, SQLModel, create_engine


Expand All @@ -21,6 +22,7 @@ class Hero(SQLModel, table=True):
session.refresh(hero_1)

with Session(engine) as session:
query_hero = session.query(Hero).first()
with pytest.warns(DeprecationWarning):
query_hero = session.query(Hero).first()
assert query_hero
assert query_hero.name == hero_1.name

0 comments on commit 5f4d502

Please sign in to comment.