Change `reraise` to `post_mortem: bool` in `maybe_expect_raises()`
parent
fcd089c08f
commit
cdb1311e40
|
@ -46,7 +46,7 @@ maybe_msg_spec = PldMsg|None
|
||||||
async def maybe_expect_raises(
|
async def maybe_expect_raises(
|
||||||
raises: BaseException|None = None,
|
raises: BaseException|None = None,
|
||||||
ensure_in_message: list[str]|None = None,
|
ensure_in_message: list[str]|None = None,
|
||||||
reraise: bool = False,
|
post_mortem: bool = False,
|
||||||
timeout: int = 3,
|
timeout: int = 3,
|
||||||
) -> None:
|
) -> None:
|
||||||
'''
|
'''
|
||||||
|
@ -86,8 +86,8 @@ async def maybe_expect_raises(
|
||||||
f'{inner_err.args}'
|
f'{inner_err.args}'
|
||||||
)
|
)
|
||||||
|
|
||||||
if reraise:
|
if post_mortem:
|
||||||
raise inner_err
|
await tractor.post_mortem()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if raises:
|
if raises:
|
||||||
|
@ -314,6 +314,8 @@ def test_basic_payload_spec(
|
||||||
f"value: `{bad_value_str}` does not "
|
f"value: `{bad_value_str}` does not "
|
||||||
f"match type-spec: `{msg_type_str}.pld: PldMsg|NoneType`",
|
f"match type-spec: `{msg_type_str}.pld: PldMsg|NoneType`",
|
||||||
],
|
],
|
||||||
|
# only for debug
|
||||||
|
post_mortem=True,
|
||||||
),
|
),
|
||||||
p.open_context(
|
p.open_context(
|
||||||
child,
|
child,
|
||||||
|
|
Loading…
Reference in New Issue