Skip to content

Commit

Permalink
use conftest.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
kain88-de committed Sep 20, 2018
1 parent ba38594 commit 72375a1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
31 changes: 31 additions & 0 deletions conftest.py
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
1 change: 0 additions & 1 deletion pmda/test/test_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from numpy.testing import assert_equal

from pmda import custom
from pmda.testing import scheduler

def custom_function(mobile):
return mobile.center_of_geometry()
Expand Down
1 change: 0 additions & 1 deletion pmda/test/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from dask import distributed, multiprocessing

from pmda import parallel
from pmda.testing import scheduler


def test_timeing():
Expand Down

0 comments on commit 72375a1

Please sign in to comment.