diff --git a/.coverage.GL738RC2e4d06aa.62433.347962 b/.coverage.GL738RC2e4d06aa.62433.347962 deleted file mode 100644 index 9ac0ae0bf..000000000 Binary files a/.coverage.GL738RC2e4d06aa.62433.347962 and /dev/null differ diff --git a/fastapi/routing.py b/fastapi/routing.py index 1d727633c..56fb85565 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -120,10 +120,10 @@ def _merge_lifespan_context( async def merged_lifespan(app: AppType) -> AsyncIterator[Mapping[str, Any]]: async with original_context(app) as maybe_self_context: async with nested_context(app) as maybe_nested_context: - context = maybe_self_context or {} - if maybe_nested_context: - context.update(maybe_nested_context) - yield context + yield { + **(maybe_self_context or {}), + **(maybe_nested_context or {}) + } return merged_lifespan