2828 CancelScope ,
2929 CapacityLimiter ,
3030 Event ,
31- TrioDeprecationWarning ,
3231 _core ,
3332 fail_after ,
3433 move_on_after ,
@@ -574,7 +573,7 @@ def release_on_behalf_of(self, borrower: Task) -> None:
574573
575574 # TODO: should CapacityLimiter have an abc or protocol so users can modify it?
576575 # because currently it's `final` so writing code like this is not allowed.
577- await to_thread_run_sync (lambda : None , limiter = CustomLimiter ()) # type: ignore[call-overload ]
576+ await to_thread_run_sync (lambda : None , limiter = CustomLimiter ()) # type: ignore[arg-type ]
578577 assert record == ["acquire" , "release" ]
579578
580579
@@ -592,7 +591,7 @@ def release_on_behalf_of(self, borrower: Task) -> NoReturn:
592591 bs = BadCapacityLimiter ()
593592
594593 with pytest .raises (ValueError , match = "^release on behalf$" ) as excinfo :
595- await to_thread_run_sync (lambda : None , limiter = bs ) # type: ignore[call-overload ]
594+ await to_thread_run_sync (lambda : None , limiter = bs ) # type: ignore[arg-type ]
596595 assert excinfo .value .__context__ is None
597596 assert record == ["acquire" , "release" ]
598597 record = []
@@ -601,7 +600,7 @@ def release_on_behalf_of(self, borrower: Task) -> NoReturn:
601600 # chains with it
602601 d : dict [str , object ] = {}
603602 with pytest .raises (ValueError , match = "^release on behalf$" ) as excinfo :
604- await to_thread_run_sync (lambda : d ["x" ], limiter = bs ) # type: ignore[call-overload ]
603+ await to_thread_run_sync (lambda : d ["x" ], limiter = bs ) # type: ignore[arg-type ]
605604 assert isinstance (excinfo .value .__context__ , KeyError )
606605 assert record == ["acquire" , "release" ]
607606
@@ -911,7 +910,7 @@ def __bool__(self) -> bool:
911910 raise NotImplementedError
912911
913912 with pytest .raises (NotImplementedError ):
914- await to_thread_run_sync (int , abandon_on_cancel = BadBool ()) # type: ignore[call-overload ]
913+ await to_thread_run_sync (int , abandon_on_cancel = BadBool ()) # type: ignore[arg-type ]
915914
916915
917916async def test_from_thread_reuses_task () -> None :
@@ -1098,28 +1097,6 @@ async def child() -> None:
10981097 nursery .start_soon (child )
10991098
11001099
1101- async def test_cancellable_and_abandon_raises () -> None :
1102- with pytest .raises (
1103- ValueError ,
1104- match = r"^Cannot set `cancellable` and `abandon_on_cancel` simultaneously\.$" ,
1105- ):
1106- await to_thread_run_sync (bool , cancellable = True , abandon_on_cancel = False ) # type: ignore[call-overload]
1107-
1108- with pytest .raises (
1109- ValueError ,
1110- match = r"^Cannot set `cancellable` and `abandon_on_cancel` simultaneously\.$" ,
1111- ):
1112- await to_thread_run_sync (bool , cancellable = True , abandon_on_cancel = True ) # type: ignore[call-overload]
1113-
1114-
1115- async def test_cancellable_warns () -> None :
1116- with pytest .warns (TrioDeprecationWarning ):
1117- await to_thread_run_sync (bool , cancellable = False )
1118-
1119- with pytest .warns (TrioDeprecationWarning ):
1120- await to_thread_run_sync (bool , cancellable = True )
1121-
1122-
11231100async def test_wait_all_threads_completed () -> None :
11241101 no_threads_left = False
11251102 e1 = Event ()
0 commit comments