Coverage for tests/test_tutorial/test_relationship_attributes/test_back_populates/test_tutorial003_py310.py: 100%
15 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-27 00:03 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-27 00:03 +0000
1from sqlalchemy import inspect 1ijklmnopqr
2from sqlalchemy.engine.reflection import Inspector 1ijklmnopqr
3from sqlmodel import create_engine 1ijklmnopqr
5from ....conftest import needs_py310 1ijklmnopqr
8@needs_py310 1ijklmnopqr
9def test_tutorial(clear_sqlmodel): 1ijklmnopqr
10 from docs_src.tutorial.relationship_attributes.back_populates import ( 1abcdefgh
11 tutorial003_py310 as mod,
12 )
14 mod.sqlite_url = "sqlite://" 1abcdefgh
15 mod.engine = create_engine(mod.sqlite_url) 1abcdefgh
16 mod.main() 1abcdefgh
17 insp: Inspector = inspect(mod.engine) 1abcdefgh
18 assert insp.has_table(str(mod.Hero.__tablename__)) 1abcdefgh
19 assert insp.has_table(str(mod.Weapon.__tablename__)) 1abcdefgh
20 assert insp.has_table(str(mod.Power.__tablename__)) 1abcdefgh
21 assert insp.has_table(str(mod.Team.__tablename__)) 1abcdefgh