Remove pytest InvocationParams backward compat
It's available since pytest 5.2, and pytest-xdist requires pytest>=6.2.
This commit is contained in:
@@ -308,11 +308,6 @@ def getinfodict():
|
||||
)
|
||||
|
||||
|
||||
def remote_initconfig(option_dict, args):
|
||||
option_dict["plugins"].append("no:terminal")
|
||||
return Config.fromdictargs(option_dict, args)
|
||||
|
||||
|
||||
def setup_config(config, basetemp):
|
||||
config.option.loadgroup = config.getvalue("dist") == "loadgroup"
|
||||
config.option.looponfail = False
|
||||
@@ -341,11 +336,7 @@ if __name__ == "__channelexec__":
|
||||
os.environ["PYTEST_XDIST_WORKER"] = workerinput["workerid"]
|
||||
os.environ["PYTEST_XDIST_WORKER_COUNT"] = str(workerinput["workercount"])
|
||||
|
||||
if hasattr(Config, "InvocationParams"):
|
||||
config = _prepareconfig(args, None)
|
||||
else:
|
||||
config = remote_initconfig(option_dict, args)
|
||||
config.args = args
|
||||
config = _prepareconfig(args, None)
|
||||
|
||||
setup_config(config, option_dict.get("basetemp"))
|
||||
config._parser.prog = os.path.basename(workerinput["mainargv"][0])
|
||||
|
||||
@@ -258,12 +258,8 @@ class WorkerController:
|
||||
def setup(self):
|
||||
self.log("setting up worker session")
|
||||
spec = self.gateway.spec
|
||||
if hasattr(self.config, "invocation_params"):
|
||||
args = [str(x) for x in self.config.invocation_params.args or ()]
|
||||
option_dict = {}
|
||||
else:
|
||||
args = self.config.args
|
||||
option_dict = vars(self.config.option)
|
||||
args = [str(x) for x in self.config.invocation_params.args or ()]
|
||||
option_dict = {}
|
||||
if not spec.popen or spec.chdir:
|
||||
args = make_reltoroot(self.nodemanager.roots, args)
|
||||
if spec.popen:
|
||||
|
||||
Reference in New Issue
Block a user