From 50e0594778d28983d2ebcabe567f9462808100ba Mon Sep 17 00:00:00 2001 From: "Shwejan Raj, Bhupathi" Date: Tue, 4 Mar 2025 17:09:04 +0530 Subject: [PATCH] adds NoOpTracerProvider test case for falcon instrumentation Signed-off-by: Shwejan Raj, Bhupathi Signed-off-by: Bhupathi Shwejan Raj --- .../tests/test_falcon.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py b/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py index 48cbdbe3f8..6c05cf9e57 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py @@ -426,6 +426,20 @@ def test_uninstrument(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) + def test_no_op_tracer_provider(self): + FalconInstrumentor().uninstrument() + + FalconInstrumentor().instrument( + tracer_provider=trace.NoOpTracerProvider() + ) + + self.memory_exporter.clear() + + self.client().simulate_get(path="/hello") + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 0) + def test_exclude_lists(self): self.client().simulate_get(path="/ping") span_list = self.memory_exporter.get_finished_spans()