Coverage for tests/test_tutorial/test_relationship_attributes/test_back_populates/test_tutorial003.py: 100%
13 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 1klmnopqrst
2from sqlalchemy.engine.reflection import Inspector 1klmnopqrst
3from sqlmodel import create_engine 1klmnopqrst
6def test_tutorial(clear_sqlmodel): 1klmnopqrst
7 from docs_src.tutorial.relationship_attributes.back_populates import ( 1abcdefghij
8 tutorial003 as mod,
9 )
11 mod.sqlite_url = "sqlite://" 1abcdefghij
12 mod.engine = create_engine(mod.sqlite_url) 1abcdefghij
13 mod.main() 1abcdefghij
14 insp: Inspector = inspect(mod.engine) 1abcdefghij
15 assert insp.has_table(str(mod.Hero.__tablename__)) 1abcdefghij
16 assert insp.has_table(str(mod.Weapon.__tablename__)) 1abcdefghij
17 assert insp.has_table(str(mod.Power.__tablename__)) 1abcdefghij
18 assert insp.has_table(str(mod.Team.__tablename__)) 1abcdefghij