Skip to content

Commit

Permalink
fix for Audit and test opentelemetry-instrumentation-jinja2 #978 (#2799)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramshankarb authored Aug 16, 2024
1 parent e7f647e commit 4108d57
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 4108d57

Please sign in to comment.