Adjust test suites to new `maybe_raise_from_masking_exc()` changes

to_asyncio_eoc_signal
Tyler Goodlet 2025-07-25 11:02:22 -04:00
parent c05d08e426
commit 4f4c7e6b67
1 changed files with 9 additions and 10 deletions

View File

@ -119,9 +119,8 @@ def test_acm_embedded_nursery_propagates_enter_err(
tractor.trionics.maybe_raise_from_masking_exc( tractor.trionics.maybe_raise_from_masking_exc(
tn=tn, tn=tn,
unmask_from=( unmask_from=(
trio.Cancelled (trio.Cancelled,) if unmask_from_canc
if unmask_from_canc else ()
else None
), ),
) )
): ):
@ -136,8 +135,7 @@ def test_acm_embedded_nursery_propagates_enter_err(
with tractor.devx.maybe_open_crash_handler( with tractor.devx.maybe_open_crash_handler(
pdb=debug_mode, pdb=debug_mode,
) as bxerr: ) as bxerr:
if bxerr: assert not bxerr.value
assert not bxerr.value
async with ( async with (
wraps_tn_that_always_cancels() as tn, wraps_tn_that_always_cancels() as tn,
@ -145,11 +143,12 @@ def test_acm_embedded_nursery_propagates_enter_err(
assert not tn.cancel_scope.cancel_called assert not tn.cancel_scope.cancel_called
assert 0 assert 0
assert ( if debug_mode:
(err := bxerr.value) assert (
and (err := bxerr.value)
type(err) is AssertionError and
) type(err) is AssertionError
)
with pytest.raises(ExceptionGroup) as excinfo: with pytest.raises(ExceptionGroup) as excinfo:
trio.run(_main) trio.run(_main)