pytest-xdist
pytest-xdist copied to clipboard
Make node ID modification more stable.
We force test collection on the controller node, as we run some global setup there before starting the workers. That setup also depends on the test node IDs, but currently, pytest-xdist only modifies the test node IDs on the workers, that've been started and where setup_config has been called. I don't see a good reason for this, and for creating a separate config entry, so let's just check the right condition in the pytest hook. That way, the hook will always do the same node ID transformation, regardless of pytest-xdist setup.
Thanks for submitting a PR, your contribution is really appreciated!
Here's a quick checklist that should be present in PRs:
-
[ ] Make sure to include reasonable tests for your change if necessary
-
[ ] We use towncrier for changelog management, so please add a news file into the
changelogfolder following these guidelines:-
Name it
$issue_id.$typefor example588.bugfix; -
If you don't have an issue_id change it to the PR id after creating it
-
Ensure type is one of
removal,feature,bugfix,vendor,docortrivial -
Make sure to use full sentences with correct case and punctuation, for example:
Fix issue with non-ascii contents in doctest text files.
-
Node id modification needs to be dropped all together
That is a good point - as all the unit tests fail on this PR anyways, I'll see what I can do.
Doing the stuff the hack with node id enabled in a more natural way is a major undertaking
Only got there as a follow-up
I'll collect feedback on https://github.com/pytest-dev/pytest-xdist/pull/1119 and if that's not a viable route, I'll try to resurrect this PR instead.