Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit and test opentelemetry-instrumentation-wsgi NoOpTracerProvider #1610

Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,21 @@ def test_basic_wsgi_call(self):
response = app(self.environ, self.start_response)
self.validate_response(response, exporter)

def test_no_op_tracer_provider(self):
app = otel_wsgi.OpenTelemetryMiddleware(
simple_wsgi, tracer_provider=trace_api.NoOpTracerProvider()
)

response = app(self.environ, self.start_response)
while True:
try:
value = next(response)
self.assertEqual(value, b"*")
except StopIteration:
break
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 0)


class TestWsgiMiddlewareWrappedWithAnotherFramework(WsgiTestBase):
def test_mark_span_internal_in_presence_of_span_from_other_framework(self):
Expand Down