Skip to content

Commit 48a5eeb

Browse files
authored
Merge branch 'main' into redis-query-sanitization
2 parents c54e64b + d1dec92 commit 48a5eeb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,15 @@ def response_hook(span, request_obj, response):
349349
self.assertIn("response_hook_attr", span.attributes)
350350
self.assertEqual(span.attributes["response_hook_attr"], "value")
351351

352+
def test_no_op_tracer_provider(self):
353+
URLLibInstrumentor().uninstrument()
354+
tracer_provider = trace.NoOpTracerProvider
355+
URLLibInstrumentor().instrument(tracer_provider=tracer_provider)
356+
357+
result = self.perform_request(self.URL)
358+
self.assertEqual(result.read(), b"Hello!")
359+
self.assert_span(num_spans=0)
360+
352361

353362
class TestRequestsIntegration(RequestsIntegrationTestBase, TestBase):
354363
@staticmethod

0 commit comments

Comments
 (0)