Commit d642491
fix(starlette): Update test for Starlette 1.0 TemplateResponse API (#5525)
## Summary
- Fix `test_template_tracing_meta` failure on `starlette==1.0.0rc1`
across all Python versions (3.10, 3.13, 3.14, 3.14t)
Closes #5523
## Analysis
Starlette 1.0.0rc1 removed the deprecated `TemplateResponse(name,
context)` calling convention
([Kludex/starlette#3118](Kludex/starlette#3118),
commit [`96479da`](Kludex/starlette@96479da)).
The new required signature is `TemplateResponse(request, name,
context)`.
When the old-style call was made, the string template name was passed as
the `request` parameter and the context dict as `name`, which then got
used as part of a Jinja2 cache key tuple, causing `TypeError: unhashable
type: 'dict'`.
The fix branches on `STARLETTE_VERSION >= (1,)` to use the new API for
Starlette 1.0+ while keeping the old API for older versions.
## Test plan
- [x] `tox -e py3.14-starlette-v1.0.0rc1` — 71 passed
- [x] `tox -e py3.14-starlette-v0.52.1` — 71 passed (no regression)
- [ ] CI passes on all Web 1 jobs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent bb6a5c9 commit d642491
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
148 | 153 | | |
149 | 154 | | |
150 | 155 | | |
| |||
0 commit comments