diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index 064af3c4f1..e647d1eb8f 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -5,6 +5,7 @@ from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker +from sqlalchemy import text from sentry_sdk import capture_message, start_transaction, configure_scope from sentry_sdk.consts import SPANDATA @@ -152,7 +153,7 @@ def test_long_sql_query_preserved(sentry_init, capture_events): engine = create_engine("sqlite:///:memory:") with start_transaction(name="test"): with engine.connect() as con: - con.execute(" UNION ".join("SELECT {}".format(i) for i in range(100))) + con.execute(text(" UNION ".join("SELECT {}".format(i) for i in range(100)))) (event,) = events description = event["spans"][0]["description"] @@ -180,7 +181,9 @@ def processor(event, hint): with start_transaction(name="test"): with engine.connect() as con: for _ in range(1500): - con.execute(" UNION ".join("SELECT {}".format(i) for i in range(100))) + con.execute( + text(" UNION ".join("SELECT {}".format(i) for i in range(100))) + ) (event,) = events @@ -218,4 +221,4 @@ def test_engine_name_not_string(sentry_init): engine.dialect.name = b"sqlite" with engine.connect() as con: - con.execute("SELECT 0") + con.execute(text("SELECT 0")) diff --git a/tox.ini b/tox.ini index b104d80ac5..b112955d57 100644 --- a/tox.ini +++ b/tox.ini @@ -147,7 +147,8 @@ envlist = {py3.8,py3.9,py3.10,py3.11}-starlite # SQL Alchemy - {py2.7,py3.7,py3.8,py3.9,py3.10,py3.11}-sqlalchemy-v{1.2,1.3} + {py2.7,py3.7,py3.8,py3.9,py3.10,py3.11}-sqlalchemy-v{1.2,1.3,1.4} + {py3.7,py3.8,py3.9,py3.10,py3.11}-sqlalchemy-v{2.0} # Tornado {py3.7,py3.8,py3.9}-tornado-v{5} @@ -426,6 +427,8 @@ deps = # SQLAlchemy sqlalchemy-v1.2: sqlalchemy>=1.2,<1.3 sqlalchemy-v1.3: sqlalchemy>=1.3,<1.4 + sqlalchemy-v1.4: sqlalchemy>=1.4,<2.0 + sqlalchemy-v2.0: sqlalchemy>=2.0,<2.1 # Tornado tornado-v5: tornado>=5,<6