Skip to content

Commit d243445

Browse files
committed
test: drop autouse gh-106749 heal fixture (ineffective; _bridge.py was the site)
The fixture ran at a different frame depth than the desync and had no effect on CI. The actual remaining throw site was StreamingASGITransport.__aexit__, healed in 7cbfd0f.
1 parent 7cbfd0f commit d243445

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

tests/conftest.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
2-
import sys
3-
from collections.abc import AsyncIterator, Iterator
2+
from collections.abc import Iterator
43

5-
import anyio.lowlevel
64
import pytest
75

86
# OpenTelemetry's `set_tracer_provider` is set-once per process, so the suite
@@ -25,31 +23,6 @@ def anyio_backend():
2523
return "asyncio"
2624

2725

28-
@pytest.fixture(autouse=True)
29-
async def _heal_gh106749(anyio_backend: str) -> AsyncIterator[None]:
30-
"""Re-sync coverage's CTracer after every async test on CPython 3.11.
31-
32-
CPython gh-106749: anyio delivers a task-group cancel via `coro.throw()`,
33-
which on 3.11 skips the outer await chain's `'call'` trace events.
34-
coverage.py's CTracer keys its frame stack on those events, so until the
35-
next `.send()` resumption, line events are misattributed and dropped. Under
36-
xdist a desync at the end of one test carries into the start of the next on
37-
the same worker; the missed lines move with worker test ordering.
38-
39-
`cancel_shielded_checkpoint()` resumes via `.send()`, re-stamping the
40-
missing events. The shielded variant is a pure scheduling yield with no
41-
cancel delivery, so it cannot perturb a test's cancel-scope nesting. The
42-
`anyio_backend` dependency makes anyio's pytest plugin own this fixture so
43-
it runs in the test's task; sync tests skip it.
44-
"""
45-
yield
46-
# The heal line itself runs while the tracer is desynced (that's the
47-
# point), so it cannot record its own execution; on non-3.11 the body is
48-
# never entered. Hence lax no cover on the whole tail.
49-
if sys.version_info[:2] == (3, 11): # pragma: lax no cover
50-
await anyio.lowlevel.cancel_shielded_checkpoint()
51-
52-
5326
@pytest.fixture(name="capfire")
5427
def _capfire_isolated(capfire: CaptureLogfire) -> Iterator[CaptureLogfire]:
5528
"""Override of logfire's `capfire` that scopes the MCP tracer to the test.

0 commit comments

Comments
 (0)