Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,16 @@ 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use trace_api.NoOpTracerProvider()
You should move to the instrument function initialized tracer_provider and not the Class object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

)

response = app(self.environ, self.start_response)
next(response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next(response) will throw a StopIteration exception if the iterator is empty

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