diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py b/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py index 542a65d220..26ba98e69b 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/tests/test_jinja2.py @@ -219,3 +219,14 @@ def test_uninstrumented(self): self.assertEqual(len(spans), 0) Jinja2Instrumentor().instrument() + + def test_no_op_tracer_provider(self): + self.memory_exporter.clear() + Jinja2Instrumentor().uninstrument() + Jinja2Instrumentor().instrument( + tracer_provider=trace_api.NoOpTracerProvider() + ) + template = jinja2.environment.Template("Hello {{name}}!") + self.assertEqual(template.render(name="Jinja"), "Hello Jinja!") + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 0)