Skip to content

Commit 8bfa02a

Browse files
committed
Using config.invocation_args
1 parent 8a00dcc commit 8bfa02a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/xdist/workermanage.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ def make_reltoroot(roots, args):
186186
for arg in args:
187187
parts = arg.split(splitcode)
188188
fspath = py.path.local(parts[0])
189+
if not fspath.exists():
190+
continue
189191
for root in roots:
190192
x = fspath.relto(root)
191193
if x or fspath == root:
@@ -236,7 +238,7 @@ def shutting_down(self):
236238
def setup(self):
237239
self.log("setting up worker session")
238240
spec = self.gateway.spec
239-
args = sys.argv[1:]
241+
args = [str(x) for x in self.config.invocation_args or ()]
240242
if not spec.popen or spec.chdir:
241243
args = make_reltoroot(self.nodemanager.roots, args)
242244
option_dict = {}

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ deps =
1212
pytestmaster: git+https://github.com/pytest-dev/pytest.git@master
1313
pytestfeatures: git+https://github.com/pytest-dev/pytest.git@features
1414
commands=
15-
pytest {posargs} --runpytest=subprocess
15+
pytest {posargs}
1616

1717
[testenv:linting]
1818
skipsdist = True

0 commit comments

Comments
 (0)