Commit Graph

7 Commits

Author SHA1 Message Date
pre-commit-ci-lite[bot] 6215c768f2
🎨 Auto format 2026-03-16 09:35:11 +00:00
essentiaMarco 17f10eb0a8 test: replace synthetic collector test with lifecycle integration and remove unreachable collector branch
Made-with: Cursor
2026-03-16 02:34:04 -07:00
essentiaMarco e0fe1666a8 test: replace synthetic private-helper coverage with real startup lifecycle scenario
Made-with: Cursor
2026-03-16 02:26:20 -07:00
essentiaMarco 466e29e1e5 fix: coverage to 100% for lifespan scope (pragmas, tests for APIRouter gen lifespans, sync dep, cache hit, unreachable test lines)
Made-with: Cursor
2026-03-15 17:47:29 -07:00
essentiaMarco c046d33b27 fix: pre-commit and type checks (ruff E731, mypy/ty cli and applications)
Made-with: Cursor
2026-03-15 17:22:43 -07:00
essentiaMarco 53ebb9b46a fix: resolve merge with master — lifespan app vs router
- Default lifespan: use app.router for _DefaultLifespan (router has
  _startup/_shutdown; FastAPI app does not).
- Wrapper: when app is FastAPI, set fastapi_app from app and pass
  app.router to _run_lifespan_dependencies so lifespan deps are collected.
- Test: use only Request.receive() (Starlette Request has no .send).

Made-with: Cursor
2026-03-15 16:59:20 -07:00
essentiaMarco 9fb0fc8120 refactor(lifespan): align with reviewer feedback, add coverage tests
- Fix _collect_lifespan_dependants: handle route-level flat.computed_scope
  and iterate flat.dependencies (was incorrectly iterating flat)
- No pragmas on noop_receive/noop_send; covered by test that uses
  Request.receive/send in a lifespan dependency
- Add test_collect_lifespan_dependants_route_level_scope for route-level
  lifespan branch
- Add test_lifespan_dependency_synthetic_request_receive_send for
  noop_receive/noop_send coverage
- Add test_lifespan_dependency_nested for dependency_cache hit (utils)
- Add test_lifespan_dependency_cannot_depend_on_request_scope and
  test_lifespan_dependency_not_initialized_raises for edge cases

Made-with: Cursor
2026-03-13 23:39:27 -07:00