-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from MDAnalysis/test-with-scheduler-fixture
test custom with scheduler fixture
- Loading branch information
Showing
4 changed files
with
49 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- | ||
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 | ||
# | ||
# PMDA | ||
# Copyright (c) 2017 The MDAnalysis Development Team and contributors | ||
# (see the file AUTHORS for the full list of names) | ||
# | ||
# Released under the GNU Public Licence, v2 or any higher version | ||
|
||
from dask import distributed, multiprocessing | ||
import pytest | ||
|
||
@pytest.fixture(scope="session", params=(1, 2)) | ||
def client(tmpdir_factory, request): | ||
with tmpdir_factory.mktemp("dask_cluster").as_cwd(): | ||
lc = distributed.LocalCluster(n_workers=request.param, processes=True) | ||
client = distributed.Client(lc) | ||
|
||
yield client | ||
|
||
client.close() | ||
lc.close() | ||
|
||
|
||
@pytest.fixture(scope='session', params=('distributed', 'multiprocessing')) | ||
def scheduler(request, client): | ||
if request.param == 'distributed': | ||
return client | ||
else: | ||
return multiprocessing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters