Commit 52a79c4
committed
backport: coverage — reset sse-starlette's module-global exit Event between tests
sse-starlette <3.0 stores an anyio.Event on AppStatus the first time an
EventSourceResponse runs, bound to that test's event loop. Under the in-process
bridge (one process, per-test event loops) every subsequent SSE response — both
the [sse] leg and connect_with_oauth's streamable-HTTP responses — fails with
'bound to a different event loop'. v1's own transport tests run uvicorn in a
subprocess and so never share a process across event loops.
The previous commit's >=2.1.0 dev floor was insufficient (2.1.0 still has the
class attribute; 3.x switched to a ContextVar). An autouse fixture that resets
the attribute after each test handles all versions including the 1.6.1 runtime
floor, so the dev floor is reverted and lowest-direct CI again exercises the
runtime constraint.
Verified: 1598 tests / 100.00% coverage on both highest and lowest-direct.1 parent 04980e3 commit 52a79c4
3 files changed
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 66 | | |
72 | 67 | | |
73 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments