Skip to content

fastapi: tests failure with >= 0.118.0 #4228

@emdneto

Description

@emdneto

One fastapi test is failing when testing with fastapi==0.118.0

======================================================== FAILURES ========================================================
______________________________________ TestFastAPIFallback.test_no_instrumentation _______________________________________

self = <tests.test_fastapi_instrumentation.TestFastAPIFallback testMethod=test_no_instrumentation>

    def test_no_instrumentation(self):
>       self.client.get(
            "/foobar",
        )

instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py:2086: 
request = <starlette.requests.Request object at 0x106ea6990>

    async def app(request: Request) -> Response:
        response: Union[Response, None] = None
        file_stack = request.scope.get("fastapi_middleware_astack")
>       assert isinstance(file_stack, AsyncExitStack), (
            "fastapi_middleware_astack not found in request scope"
        )
E       AssertionError: fastapi_middleware_astack not found in request scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions