Skip to content

Commit 3b7679f

Browse files
committed
start distributed.Client inside runner test
1 parent b3e4ca3 commit 3b7679f

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

adaptive/tests/test_runner.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,6 @@ def ipyparallel_executor():
8787
raise RuntimeError("Could not stop ipcluster")
8888

8989

90-
@pytest.fixture(scope="session")
91-
def dask_executor():
92-
from distributed import Client
93-
94-
client = Client(n_workers=1)
95-
yield client
96-
client.close()
97-
98-
9990
def linear(x):
10091
return x
10192

@@ -130,7 +121,11 @@ def test_ipyparallel_executor(ipyparallel_executor):
130121
@pytest.mark.timeout(60)
131122
@pytest.mark.skipif(not with_distributed, reason="dask.distributed is not installed")
132123
@pytest.mark.skipif(sys.version_info[:2] == (3, 8), reason="XXX: seems to always fail")
133-
def test_distributed_executor(dask_executor):
124+
def test_distributed_executor():
125+
from distributed import Client
126+
134127
learner = Learner1D(linear, (-1, 1))
135-
BlockingRunner(learner, trivial_goal, executor=dask_executor)
128+
client = Client(n_workers=1)
129+
BlockingRunner(learner, trivial_goal, executor=client)
130+
client.shutdown()
136131
assert learner.npoints > 0

0 commit comments

Comments
 (0)