From c0fd68db0465849eb760baaa3295b4d3e965433f Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Sun, 1 Apr 2018 17:24:43 -0400 Subject: [PATCH] Test start_workers/stop_workers with trivial args Add a test to ensure that `start_workers` can be passed `n = 0` without issues. Also ensure this translates into no workers being added. Further test that `stop_workers` can be called with an empty dictionary. --- dask_drmaa/tests/test_core.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dask_drmaa/tests/test_core.py b/dask_drmaa/tests/test_core.py index e4d2f01..d31f967 100644 --- a/dask_drmaa/tests/test_core.py +++ b/dask_drmaa/tests/test_core.py @@ -15,6 +15,16 @@ from distributed.utils import tmpfile +def test_no_workers(loop): + with DRMAACluster(scheduler_port=0) as cluster: + with Client(cluster, loop=loop) as client: + cluster.start_workers(0) + assert not cluster.workers + cluster.stop_workers({}) + + assert not os.path.exists(cluster.script) + + def test_simple(loop): with DRMAACluster(scheduler_port=0) as cluster: with Client(cluster, loop=loop) as client: