diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py index 73c96ede1..5f1a5720b 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py @@ -349,6 +349,15 @@ class RequestsIntegrationTestBase(abc.ABC): self.assertIn("response_hook_attr", span.attributes) self.assertEqual(span.attributes["response_hook_attr"], "value") + def test_no_op_tracer_provider(self): + URLLibInstrumentor().uninstrument() + tracer_provider = trace.NoOpTracerProvider + URLLibInstrumentor().instrument(tracer_provider=tracer_provider) + + result = self.perform_request(self.URL) + self.assertEqual(result.read(), b"Hello!") + self.assert_span(num_spans=0) + class TestRequestsIntegration(RequestsIntegrationTestBase, TestBase): @staticmethod