Commit dc154d5
committed
fix(tests): add no-branch pragma for nested async with ClientSession
On Python 3.11+, coverage.py fails to track the ->exit arc from the
innermost async with body when it yields inside 3+ nested async with
blocks (the async generator frame unwinds through __aexit__ chains
differently than 3.10). The codebase already uses # pragma: no branch
for this pattern on existing ClientSession fixtures; apply it to the
new ASGI-backed fixtures added in the previous commit.
Fixes the 5 ->exit branch misses reported on CI 3.11-3.14:
test_http_unicode.py:124->exit
test_streamable_http.py:979->exit, 1463->exit, 1523->exit, 2130->exit1 parent b068384 commit dc154d5
2 files changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
979 | | - | |
| 979 | + | |
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| |||
1460 | 1460 | | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | | - | |
| 1463 | + | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
| |||
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
1523 | | - | |
| 1523 | + | |
1524 | 1524 | | |
1525 | 1525 | | |
1526 | 1526 | | |
| |||
2127 | 2127 | | |
2128 | 2128 | | |
2129 | 2129 | | |
2130 | | - | |
| 2130 | + | |
2131 | 2131 | | |
2132 | 2132 | | |
2133 | 2133 | | |
| |||
0 commit comments