Skip to content

Commit

Permalink
fix(tests): adjust indexes tests for sqlalchemy/1.4.45
Browse files Browse the repository at this point in the history
This addresses the tests failures as seen in #510
  • Loading branch information
sandrotosi authored Dec 27, 2022
1 parent 7b3148c commit 18bc56e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def test_tutorial(clear_sqlmodel):
insp: Inspector = inspect(mod.engine)
indexes = insp.get_indexes(str(mod.Hero.__tablename__))
expected_indexes = [
{"name": "ix_hero_name", "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "column_names": ["age"], "unique": 0},
{"name": "ix_hero_name", "dialect_options": {}, "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "dialect_options": {}, "column_names": ["age"], "unique": 0},
]
for index in expected_indexes:
assert index in indexes, "This expected index should be in the indexes in DB"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def test_tutorial(clear_sqlmodel):
insp: Inspector = inspect(mod.engine)
indexes = insp.get_indexes(str(mod.Hero.__tablename__))
expected_indexes = [
{"name": "ix_hero_age", "column_names": ["age"], "unique": 0},
{"name": "ix_hero_name", "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "dialect_options": {}, "column_names": ["age"], "unique": 0},
{"name": "ix_hero_name", "dialect_options": {}, "column_names": ["name"], "unique": 0},
]
for index in expected_indexes:
assert index in indexes, "This expected index should be in the indexes in DB"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tutorial/test_indexes/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def test_tutorial(clear_sqlmodel):
insp: Inspector = inspect(mod.engine)
indexes = insp.get_indexes(str(mod.Hero.__tablename__))
expected_indexes = [
{"name": "ix_hero_name", "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "column_names": ["age"], "unique": 0},
{"name": "ix_hero_name", "dialect_options": {}, "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "dialect_options": {}, "column_names": ["age"], "unique": 0},
]
for index in expected_indexes:
assert index in indexes, "This expected index should be in the indexes in DB"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tutorial/test_indexes/test_tutorial006.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def test_tutorial(clear_sqlmodel):
insp: Inspector = inspect(mod.engine)
indexes = insp.get_indexes(str(mod.Hero.__tablename__))
expected_indexes = [
{"name": "ix_hero_name", "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "column_names": ["age"], "unique": 0},
{"name": "ix_hero_name", "dialect_options": {}, "column_names": ["name"], "unique": 0},
{"name": "ix_hero_age", "dialect_options": {}, "column_names": ["age"], "unique": 0},
]
for index in expected_indexes:
assert index in indexes, "This expected index should be in the indexes in DB"
Expand Down

0 comments on commit 18bc56e

Please sign in to comment.