Fix for test failure caused by SQLite 3.37.0+, closes #1647

This commit is contained in:
Simon Willison 2022-03-05 11:45:04 -08:00
commit 727ebc8a83
2 changed files with 10 additions and 2 deletions

View file

@ -279,7 +279,15 @@ async def test_table_columns(db, table, expected):
@pytest.mark.asyncio
async def test_table_column_details(db, table, expected):
columns = await db.table_column_details(table)
assert columns == expected
# Convert "type" to lowercase before comparison
# https://github.com/simonw/datasette/issues/1647
compare_columns = [
Column(
c.cid, c.name, c.type.lower(), c.notnull, c.default_value, c.is_pk, c.hidden
)
for c in columns
]
assert compare_columns == expected
@pytest.mark.asyncio