]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
⬆️ Upgrade support for SQLAlchemy 1.4.49, update tests (#519)
authorSandro Tosi <sandrotosi@users.noreply.github.com>
Mon, 23 Oct 2023 11:22:10 +0000 (07:22 -0400)
committerGitHub <noreply@github.com>
Mon, 23 Oct 2023 11:22:10 +0000 (15:22 +0400)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pyproject.toml
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial001.py
tests/test_tutorial/test_fastapi/test_multiple_models/test_tutorial002.py
tests/test_tutorial/test_indexes/test_tutorial001.py
tests/test_tutorial/test_indexes/test_tutorial006.py

index cd59bd4cf4bd53f0246d1229c69d6bb481352af9..94fe55d2e096e2d573057770af8ff57c0a78a3d5 100644 (file)
@@ -31,7 +31,7 @@ classifiers = [
 
 [tool.poetry.dependencies]
 python = "^3.7"
-SQLAlchemy = ">=1.4.29,<=1.4.41"
+SQLAlchemy = ">=1.4.29,<2.0.0"
 pydantic = "^1.8.2"
 sqlalchemy2-stubs = {version = "*", allow-prereleases = true}
 
index 8ad038f98a7e2c099472dca23a207386c54d5368..8d99cf9f5bdd83793e8b38f65268eee17d461427 100644 (file)
@@ -172,8 +172,18 @@ 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"
index 9fd328238a6e566bc6d7bc8d05587e751995edf1..94a41b307622d689d8f233298408aee18604f784 100644 (file)
@@ -172,8 +172,18 @@ 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"
index 596207737d932bea36d758f8077631af0ae35320..f33db5bcc73c318edf2343197ff857282ee0acdf 100644 (file)
@@ -25,8 +25,18 @@ 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"
index e26f8b2ed835fa4e67ae2e80ae81e70459c4175d..893043dad16c75cf3b27e9d733360152712f0e9a 100644 (file)
@@ -26,8 +26,18 @@ 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"