Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang committed Dec 20, 2024
1 parent f07d782 commit 2ae52d8
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

from alembic.config import Config
from phoenix.db import models
from sqlalchemy import (
Engine,
select,
)
from sqlalchemy import Engine, select
from sqlalchemy.orm import sessionmaker

from . import _up
Expand All @@ -32,11 +29,13 @@ def test_prompt_versions(
prompt_version = models.PromptVersion(**values)
session.add(prompt_version)
assert (id_ := prompt_version.id) is not None
with db.begin() as session:
assert session.scalar(select(models.PromptVersion.id).filter_by(id=id_)) is not None
with db.begin() as session:
session.delete(prompt_version)
with db.begin() as session:
assert session.scalar(select(models.PromptVersion.id).filter_by(id=id_)) is None
with db.begin() as session:
prompt_version = models.PromptVersion(**values)
session.add(prompt_version)
assert prompt_version.id > id_
new_prompt_version = models.PromptVersion(**values)
session.add(new_prompt_version)
assert new_prompt_version.id > id_

0 comments on commit 2ae52d8

Please sign in to comment.