From 4a79ac4f7010638c7352b76a926420c2f9caf5dd Mon Sep 17 00:00:00 2001 From: A5rocks Date: Sun, 24 Nov 2024 19:09:28 +0900 Subject: [PATCH] Handle pyright's differences --- src/trio/_tests/type_tests/raisesgroup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/trio/_tests/type_tests/raisesgroup.py b/src/trio/_tests/type_tests/raisesgroup.py index 08287528d..fb3810570 100644 --- a/src/trio/_tests/type_tests/raisesgroup.py +++ b/src/trio/_tests/type_tests/raisesgroup.py @@ -223,11 +223,15 @@ def check_triple_nested_raisesgroup() -> None: def check_check_typing() -> None: - assert_type( # type: ignore - RaisesGroup(ValueError).check, + # fmt: off + # mypy raises an error on `assert_type` + # pyright raises an error on `RaisesGroup(ValueError).check` + # to satisfy both, need to disable formatting and put it on one line + assert_type(RaisesGroup(ValueError).check, # type: ignore Union[ Callable[[BaseExceptionGroup[ValueError]], None], Callable[[ExceptionGroup[ValueError]], None], None, ], ) + # fmt: on