diff --git a/changelog/1118.bugfix b/changelog/1118.bugfix new file mode 100644 index 00000000..1d984b68 --- /dev/null +++ b/changelog/1118.bugfix @@ -0,0 +1 @@ +Loadgroup: Always apply the node ID transformation, even if test collection is run on the controller node. diff --git a/src/xdist/remote.py b/src/xdist/remote.py index dd1f9883..6f244f46 100644 --- a/src/xdist/remote.py +++ b/src/xdist/remote.py @@ -207,7 +207,7 @@ def pytest_collection_modifyitems( items: list[pytest.Item], ) -> None: # add the group name to nodeid as suffix if --dist=loadgroup - if config.getvalue("loadgroup"): + if config.getoption("dist") == "loadgroup": for item in items: mark = item.get_closest_marker("xdist_group") if not mark: @@ -356,7 +356,6 @@ def getinfodict() -> WorkerInfo: def setup_config(config: pytest.Config, basetemp: str | None) -> None: - config.option.loadgroup = config.getvalue("dist") == "loadgroup" config.option.looponfail = False config.option.usepdb = False config.option.dist = "no"