11import asyncio
22import time
3- from typing import Callable , Iterator
3+ from typing import Callable
44
55import pytest
6- from distributed .client import Client
76
87from adaptive .learner import BaseLearner , Learner1D , Learner2D
98from adaptive .runner import (
@@ -71,7 +70,7 @@ async def f(x):
7170
7271
7372@pytest .fixture (scope = "session" )
74- def ipyparallel_executor () -> Iterator [ Client ] :
73+ def ipyparallel_executor ():
7574 from ipyparallel import Client
7675 import pexpect
7776
@@ -83,7 +82,7 @@ def ipyparallel_executor() -> Iterator[Client]:
8382
8483
8584@pytest .fixture (scope = "session" )
86- def dask_executor () -> Iterator [ Client ] :
85+ def dask_executor ():
8786 from distributed import Client
8887
8988 client = Client (n_workers = 1 )
@@ -114,15 +113,15 @@ def test_stop_after_goal() -> None:
114113
115114
116115@pytest .mark .skipif (not with_ipyparallel , reason = "IPyparallel is not installed" )
117- def test_ipyparallel_executor (ipyparallel_executor : Client ) -> None :
116+ def test_ipyparallel_executor (ipyparallel_executor ) -> None :
118117 learner = Learner1D (linear , (- 1 , 1 ))
119118 BlockingRunner (learner , trivial_goal , executor = ipyparallel_executor )
120119 assert learner .npoints > 0
121120
122121
123122@pytest .mark .timeout (60 )
124123@pytest .mark .skipif (not with_distributed , reason = "dask.distributed is not installed" )
125- def test_distributed_executor (dask_executor : Client ) -> None :
124+ def test_distributed_executor (dask_executor ) -> None :
126125 learner = Learner1D (linear , (- 1 , 1 ))
127126 BlockingRunner (learner , trivial_goal , executor = dask_executor )
128127 assert learner .npoints > 0
0 commit comments