Skip to content

Commit

Permalink
Add some debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoRoth committed Apr 18, 2018
1 parent 8befa6e commit 759a4f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions oggm/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@
class OggmMpLockPlugin():
def pytest_configure(config):
if hasattr(config, 'workerinput'):
print("In configure as slave")
utils.lock = pickle.loads(config.workerinput['shared_lock'])
cfg.unpack_config(pickle.loads(config.workerinput['shared_cfg']))
else:
print("In configure as master")
config.shared_lock = mp.Manager().Lock()
config.shared_cfg = cfg.pack_config()

def pytest_configure_node(node):
print("In config node")
node.workerinput['shared_lock'] = pickle.dumps(node.config.shared_lock)
node.workerinput['shared_cfg'] = pickle.dumps(node.config.shared_cfg)

def pytest_configure(config):
print("In outer pytest_configure")
if config.pluginmanager.hasplugin('xdist'):
print("Registering plugin")
config.pluginmanager.register(OggmMpLockPlugin())

print("Conftest loaded")

0 comments on commit 759a4f1

Please sign in to comment.