Skip to content

Commit 05bd866

Browse files
Fix tests
1 parent 5b70387 commit 05bd866

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,12 @@ async def run():
129129
def test_not_recording(self):
130130
mock_tracer = mock.Mock()
131131
mock_span = mock.Mock()
132+
mock_context = mock.Mock()
132133
mock_span.is_recording.return_value = False
133-
mock_span.__enter__ = mock.Mock(return_value=(mock.Mock(), None))
134-
mock_span.__exit__ = mock.Mock(return_value=None)
135-
mock_tracer.start_span.return_value = mock_span
136-
mock_tracer.start_as_current_span.return_value = mock_span
134+
mock_context.__enter__ = mock.Mock(return_value=mock_span)
135+
mock_context.__exit__ = mock.Mock(return_value=None)
136+
mock_tracer.start_span.return_value = mock_context
137+
mock_tracer.start_as_current_span.return_value = mock_context
137138
with mock.patch("opentelemetry.trace.get_tracer") as tracer:
138139
tracer.return_value = mock_tracer
139140
engine = create_engine("sqlite:///:memory:")

0 commit comments

Comments
 (0)