File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
instrumentation/opentelemetry-instrumentation-dbapi/tests Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,21 @@ def test_custom_tracer_provider_dbapi(self):
219
219
self .assertEqual (span .resource .attributes ["db-resource-key" ], "value" )
220
220
self .assertIs (span .status .status_code , trace_api .StatusCode .ERROR )
221
221
222
+ def test_no_op_tracer_provider (self ):
223
+ db_integration = dbapi .DatabaseApiIntegration (
224
+ self .tracer ,
225
+ "testcomponent" ,
226
+ tracer_provider = trace_api .NoOpTracerProvider (),
227
+ )
228
+
229
+ mock_connection = db_integration .wrapped_connection (
230
+ mock_connect , {}, {}
231
+ )
232
+ cursor = mock_connection .cursor ()
233
+ cursor .executemany ("Test query" )
234
+ spans_list = self .memory_exporter .get_finished_spans ()
235
+ self .assertEqual (len (spans_list ), 0 )
236
+
222
237
def test_executemany (self ):
223
238
db_integration = dbapi .DatabaseApiIntegration (
224
239
"testname" , "testcomponent"
You can’t perform that action at this time.
0 commit comments