File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
instrumentation/opentelemetry-instrumentation-aiohttp-client/tests Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 26
26
from pkg_resources import iter_entry_points
27
27
28
28
from opentelemetry import context
29
+ from opentelemetry import trace as trace_api
29
30
from opentelemetry .instrumentation import aiohttp_client
30
31
from opentelemetry .instrumentation .aiohttp_client import (
31
32
AioHttpClientInstrumentor ,
@@ -434,6 +435,18 @@ async def create_session(server: aiohttp.test_utils.TestServer):
434
435
run_with_test_server (create_session , self .URL , self .default_handler )
435
436
self .assert_spans (1 )
436
437
438
+ def test_no_op_tracer_provider (self ):
439
+ AioHttpClientInstrumentor ().uninstrument ()
440
+ AioHttpClientInstrumentor ().instrument (
441
+ tracer_provider = trace_api .NoOpTracerProvider ()
442
+ )
443
+
444
+ run_with_test_server (
445
+ self .get_default_request (), self .URL , self .default_handler
446
+ )
447
+ spans_list = self .memory_exporter .get_finished_spans ()
448
+ self .assertEqual (len (spans_list ), 0 )
449
+
437
450
def test_uninstrument (self ):
438
451
AioHttpClientInstrumentor ().uninstrument ()
439
452
run_with_test_server (
You can’t perform that action at this time.
0 commit comments