mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-28 04:34:01 +08:00
add a test for urllib3 using NoOpTracerProvider (#1574)
This commit is contained in:
@ -330,3 +330,12 @@ class TestURLLib3Instrumentor(TestBase):
|
||||
|
||||
self.assertIn("request_hook_body", span.attributes)
|
||||
self.assertEqual(span.attributes["request_hook_body"], body)
|
||||
|
||||
def test_no_op_tracer_provider(self):
|
||||
URLLib3Instrumentor().uninstrument()
|
||||
tracer_provider = trace.NoOpTracerProvider()
|
||||
URLLib3Instrumentor().instrument(tracer_provider=tracer_provider)
|
||||
|
||||
response = self.perform_request(self.HTTP_URL)
|
||||
self.assertEqual(b"Hello!", response.data)
|
||||
self.assert_span(num_spans=0)
|
||||
|
Reference in New Issue
Block a user