Skip to content

Commit 280a120

Browse files
committed
fix sqlalchemy test
1 parent b5061e9 commit 280a120

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/integrations/sqlalchemy/test_sqlalchemy.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,19 +1080,19 @@ class Person(Base):
10801080

10811081
class fake_record_sql_queries: # noqa: N801
10821082
def __init__(self, *args, **kwargs):
1083-
with record_sql_queries_supporting_streaming(
1083+
self._ctx_mgr = record_sql_queries_supporting_streaming(
10841084
*args, **kwargs
1085-
) as span:
1086-
self.span = span
1085+
)
10871086

1087+
def __enter__(self):
1088+
self.span = self._ctx_mgr.__enter__()
10881089
self.span._start_timestamp = datetime(2024, 1, 1, microsecond=0)
10891090
self.span._end_timestamp = datetime(2024, 1, 1, microsecond=101000)
1090-
1091-
def __enter__(self):
10921091
return self.span
10931092

10941093
def __exit__(self, type, value, traceback):
1095-
pass
1094+
self.span._end_timestamp = None
1095+
self._ctx_mgr.__exit__(type, value, traceback)
10961096

10971097
with mock.patch(
10981098
"sentry_sdk.integrations.sqlalchemy.record_sql_queries_supporting_streaming",

0 commit comments

Comments
 (0)