This commit is contained in:
@@ -24,7 +24,6 @@ def engine() -> Generator[Engine, None, None]:
|
||||
yield e
|
||||
finally:
|
||||
SQLModel.metadata.drop_all(e)
|
||||
SQLModel.metadata.clear()
|
||||
e.dispose()
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ def database_ctx(db: Database) -> Generator[Database, None, None]:
|
||||
yield db
|
||||
finally:
|
||||
db.dispose()
|
||||
SQLModel.metadata.clear()
|
||||
|
||||
|
||||
def test_select_one_executes() -> None:
|
||||
@@ -77,6 +76,7 @@ def test_sqlite_pragmas_applied() -> None:
|
||||
|
||||
def test_rollback_on_exception() -> None:
|
||||
db = create_database(None)
|
||||
SQLModel.metadata.clear()
|
||||
db.init_db()
|
||||
with database_ctx(db):
|
||||
# Create table then insert and raise inside the same session to force rollback
|
||||
|
||||
@@ -13,6 +13,7 @@ def _base_type_of(compiled: str) -> str:
|
||||
|
||||
def test_run_migrations_0_to_1(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
# in-memory engine that preserves the same connection (StaticPool)
|
||||
SQLModel.metadata.clear()
|
||||
engine = create_engine(
|
||||
"sqlite:///:memory:",
|
||||
connect_args={"check_same_thread": False},
|
||||
|
||||
Reference in New Issue
Block a user