| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | from typing import Optional | |
| 2 | 2 | ||
| 3 | + import pytest | ||
| 3 | 4 | from sqlmodel import Field, Session, SQLModel, create_engine | |
| 4 | 5 | ||
| 5 | 6 | ||
@@ -21,6 +22,7 @@ class Hero(SQLModel, table=True): | |||
| 21 | 22 | session.refresh(hero_1) | |
| 22 | 23 | ||
| 23 | 24 | with Session(engine) as session: | |
| 24 | - query_hero = session.query(Hero).first() | ||
| 25 | + with pytest.warns(DeprecationWarning): | ||
| 26 | + query_hero = session.query(Hero).first() | ||
| 25 | 27 | assert query_hero | |
| 26 | 28 | assert query_hero.name == hero_1.name | |
| Back | FazBrowse Home | New Git URL |
0 commit comments