Commit f8fa20a
✅ Remove unreachable guard in get_sse_data_type; add subclass coverage test
Pydantic BaseModel subclasses always have __pydantic_generic_metadata__, so
the `if not meta` early-return was dead code. Collapse it into a ternary and
add a test for a plain (non-parameterized) ServerSentEvent subclass to reach
the `not args` branch, bringing fastapi/sse.py to 100% coverage.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 141d3d2 commit f8fa20a
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 267 | + | |
270 | 268 | | |
271 | 269 | | |
272 | 270 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
343 | 352 | | |
344 | 353 | | |
345 | 354 | | |
| |||
0 commit comments