From 4f4c7e6b67c95adc71eeb00936799a2bd6d8e35c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 25 Jul 2025 11:02:22 -0400 Subject: [PATCH] Adjust test suites to new `maybe_raise_from_masking_exc()` changes --- tests/test_trioisms.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/test_trioisms.py b/tests/test_trioisms.py index c68d75c1..7f6caa6e 100644 --- a/tests/test_trioisms.py +++ b/tests/test_trioisms.py @@ -119,9 +119,8 @@ def test_acm_embedded_nursery_propagates_enter_err( tractor.trionics.maybe_raise_from_masking_exc( tn=tn, unmask_from=( - trio.Cancelled - if unmask_from_canc - else None + (trio.Cancelled,) if unmask_from_canc + else () ), ) ): @@ -136,8 +135,7 @@ def test_acm_embedded_nursery_propagates_enter_err( with tractor.devx.maybe_open_crash_handler( pdb=debug_mode, ) as bxerr: - if bxerr: - assert not bxerr.value + assert not bxerr.value async with ( 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 0 - assert ( - (err := bxerr.value) - and - type(err) is AssertionError - ) + if debug_mode: + assert ( + (err := bxerr.value) + and + type(err) is AssertionError + ) with pytest.raises(ExceptionGroup) as excinfo: trio.run(_main)