Skip to content

Commit

Permalink
Setup distributed lock for testing
Browse files Browse the repository at this point in the history
Needs ilock from pypi to work, will do nothing if not present.
  • Loading branch information
TimoRoth committed Apr 20, 2018
1 parent 00b8314 commit 52deffd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions oggm/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pytest
import logging
import multiprocessing as mp
from oggm import cfg, utils
import pickle

logger = logging.getLogger(__name__)

def pytest_configure(config):
logger.info("in outer pytest_configure")
if config.pluginmanager.hasplugin('xdist'):
logger.info("has xdist")
try:
from ilock import ILock
utils.lock = ILock("oggm_download_lock")
logger.info("ilock locking setup successfully")
except:
logger.info("could not setup ilock locking")

logger.info("conftest loaded")

0 comments on commit 52deffd

Please sign in to comment.