Skip to content

Commit

Permalink
Ressurect xdist with try/except block
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmoore committed Jan 23, 2020
1 parent 6f84881 commit 11f81d5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/tools/OmeroPy/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,15 @@ def pytest_configure(config):
os.environ["OMERO_USERDIR"] = workdir(workerid)


try:
import xdist # noqa

def pytest_configure_node(node):
if hasattr(node, 'slaveinput'):
workerid = node.slaveinput["workerid"]
os.environ["OMERO_USERDIR"] = workdir(workerid)
except ImportError:
pass


pytest_plugins = "omero.gateway.pytest_fixtures"
11 changes: 11 additions & 0 deletions components/tools/OmeroWeb/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ def pytest_configure(config):
if not hasattr(config, 'slaveinput'):
workerid = 'main'
os.environ["OMERO_USERDIR"] = workdir(workerid)


try:
import xdist # noqa

def pytest_configure_node(node):
if hasattr(node, 'slaveinput'):
workerid = node.slaveinput["workerid"]
os.environ["OMERO_USERDIR"] = workdir(workerid)
except ImportError:
pass

0 comments on commit 11f81d5

Please sign in to comment.