File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
instrumentation/opentelemetry-instrumentation-asgi/tests Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -801,18 +801,15 @@ class TestAsgiApplicationRaisingError(AsgiTestBase):
801801 def tearDown (self ):
802802 pass
803803
804- @mock .patch (
805- "opentelemetry.instrumentation.asgi.collect_custom_headers_attributes" ,
806- side_effect = ValueError ("whatever" ),
807- )
808- def test_asgi_issue_1883 (
809- self , mock_collect_custom_request_headers_attributes
810- ):
804+ def test_asgi_issue_1883 (self ):
811805 """
812806 Test that exception UnboundLocalError local variable 'start' referenced before assignment is not raised
813807 See https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1883
814808 """
815- app = otel_asgi .OpenTelemetryMiddleware (simple_asgi )
809+ async def bad_app (_scope , _receive , _send ):
810+ raise ValueError ("whatever" )
811+
812+ app = otel_asgi .OpenTelemetryMiddleware (bad_app )
816813 self .seed_app (app )
817814 self .send_default_request ()
818815 try :
You can’t perform that action at this time.
0 commit comments