Coverage for tests/test_tutorial/test_create_db_and_table/test_tutorial002_py310.py: 100%
12 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 00:02 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 00:02 +0000
1from sqlalchemy import inspect 1iabcde
2from sqlalchemy.engine.reflection import Inspector 1iabcde
3from sqlmodel import create_engine 1iabcde
5from ...conftest import needs_py310 1iabcde
8@needs_py310 1iabcde
9def test_create_db_and_table(clear_sqlmodel): 1abcde
10 from docs_src.tutorial.create_db_and_table import tutorial002_py310 as mod 1fgh
12 mod.sqlite_url = "sqlite://" 1fgh
13 mod.engine = create_engine(mod.sqlite_url) 1fgh
14 mod.create_db_and_tables() 1fgh
15 insp: Inspector = inspect(mod.engine) 1fgh
16 assert insp.has_table(str(mod.Hero.__tablename__)) 1fgh