Skip to content

Commit e5f1579

Browse files
committed
fix issue
1 parent 4f3b83d commit e5f1579

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,17 @@ def test_instrument_client_called_on_the_class(self):
928928
self.assertEqual(result.text, "Hello!")
929929
self.assert_span(num_spans=1)
930930

931+
def test_instrument_multiple_clients_with_the_same_transport(self):
932+
client1 = self.create_client()
933+
client2 = self.create_client(transport=client1._transport)
934+
935+
HTTPXClientInstrumentor().instrument_client(client1)
936+
HTTPXClientInstrumentor().instrument_client(client2)
937+
938+
result = self.perform_request(self.URL, client=client1)
939+
self.assertEqual(result.text, "Hello!")
940+
self.assert_span(num_spans=1)
941+
931942
def test_instrumentation_without_client(self):
932943
HTTPXClientInstrumentor().instrument()
933944
results = [
@@ -1136,18 +1147,6 @@ def test_credential_removal(self):
11361147

11371148
self.assertEqual(span.attributes[SpanAttributes.HTTP_URL], self.URL)
11381149

1139-
def test_instrument_multiple_clients_with_the_same_transport(self):
1140-
transport = self.create_transport()
1141-
client1 = self.create_client(transport=transport)
1142-
client2 = self.create_client(transport=transport)
1143-
1144-
HTTPXClientInstrumentor().instrument_client(client1)
1145-
HTTPXClientInstrumentor().instrument_client(client2)
1146-
1147-
result = self.perform_request(self.URL, client=client1)
1148-
self.assertEqual(result.text, "Hello!")
1149-
self.assert_span(num_spans=1)
1150-
11511150

11521151
class TestAsyncIntegration(BaseTestCases.BaseManualTest):
11531152
response_hook = staticmethod(_async_response_hook)

0 commit comments

Comments
 (0)