Skip to content

Commit af039db

Browse files
acn-ericlawclaude
andcommitted
chore: unshadow entry-scope locals in the sync-bridge tests
Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent aa451dc commit af039db

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎tests/test_bus.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ async def helper(_headers: dict[str, str], _body: Body):
165165
return {"helper_trace": info.trace_id, "helper_cid": info.cid}
166166

167167
def entry(_headers: dict[str, str], body: Body): # plain def - executor thread
168-
po = PostOffice(registry=registry)
169-
reply = po.request_sync("bus.sync.helper", body=body, timeout_ms=5000)
170-
assert isinstance(reply.body, dict)
171-
return {"entry": "sync", **reply.body}
168+
entry_po = PostOffice(registry=registry)
169+
inner = entry_po.request_sync("bus.sync.helper", body=body, timeout_ms=5000)
170+
assert isinstance(inner.body, dict)
171+
return {"entry": "sync", **inner.body}
172172

173173
registry.register("bus.sync.helper", helper, private=True)
174174
registry.register("bus.sync.entry", entry)
@@ -204,16 +204,16 @@ def bare_thread() -> None: # no host loop in this thread's context
204204
assert caught[0].startswith("No Mercury host event loop in context")
205205

206206

207-
async def test_sync_bridge_shapes_envelope_errors_and_acks(registry: FunctionRegistry):
207+
async def test_sync_bridge_shapes_envelope_errors_and_ack(registry: FunctionRegistry):
208208
seen = asyncio.Event()
209209

210210
async def sink(_headers: dict[str, str], _body: Body):
211211
seen.set()
212212

213213
def entry(_headers: dict[str, str], _body: Body):
214-
po = PostOffice(registry=registry)
215-
missing = po.request_sync("bus.no.where", body={}, timeout_ms=1000)
216-
ack = po.send_sync("bus.sync.sink", body={"n": 1})
214+
entry_po = PostOffice(registry=registry)
215+
missing = entry_po.request_sync("bus.no.where", body={}, timeout_ms=1000)
216+
ack = entry_po.send_sync("bus.sync.sink", body={"n": 1})
217217
return {"missing_status": missing.get_status(), "missing_body": missing.body,
218218
"ack_status": ack.get_status()}
219219

0 commit comments

Comments
 (0)