Coverage for tests/test_tutorial/test_create_db_and_table/test_tutorial003.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 00:02 +0000

1from sqlalchemy import inspect 1ghijkl

2from sqlalchemy.engine.reflection import Inspector 1ghijkl

3from sqlmodel import create_engine 1ghijkl

4 

5 

6def test_create_db_and_table(clear_sqlmodel): 1ghijkl

7 from docs_src.tutorial.create_db_and_table import tutorial003 as mod 1abcdef

8 

9 mod.sqlite_url = "sqlite://" 1abcdef

10 mod.engine = create_engine(mod.sqlite_url) 1abcdef

11 mod.create_db_and_tables() 1abcdef

12 insp: Inspector = inspect(mod.engine) 1abcdef

13 assert insp.has_table(str(mod.Hero.__tablename__)) 1abcdef