Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io

from sqlalchemy import text
from sqlbag import S, temporary_database


Expand Down Expand Up @@ -58,16 +59,20 @@ def test_table_creation_idempotent(self):

# Verify table exists by querying it
rows = s.execute(
"SELECT table_name FROM information_schema.tables "
"WHERE table_name = 'migradiff_history'"
text(
"SELECT table_name FROM information_schema.tables "
"WHERE table_name = 'migradiff_history'"
)
).fetchall()
assert len(rows) == 1

# Verify columns
cols = s.execute(
"SELECT column_name, data_type FROM information_schema.columns "
"WHERE table_name = 'migradiff_history' "
"ORDER BY ordinal_position"
text(
"SELECT column_name, data_type FROM information_schema.columns "
"WHERE table_name = 'migradiff_history' "
"ORDER BY ordinal_position"
)
).fetchall()
col_names = [c[0] for c in cols]
assert "id" in col_names
Expand Down Expand Up @@ -95,7 +100,7 @@ def test_default_rollback_status(self):
forward_sql="SELECT 1;",
)
row = s.execute(
"SELECT rollback_status FROM migradiff_history"
text("SELECT rollback_status FROM migradiff_history")
).fetchone()
assert row[0] == "not_attempted"

Expand Down
Loading