Skip to content

Commit

Permalink
Handle pyright's differences
Browse files Browse the repository at this point in the history
  • Loading branch information
A5rocks committed Nov 24, 2024
1 parent 8a636ef commit 4a79ac4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/trio/_tests/type_tests/raisesgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4a79ac4

Please sign in to comment.