New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support pytest-xdist 2 #861
Conversation
@@ -46,7 +46,7 @@ def django_db_modify_db_settings_tox_suffix(): | |||
def django_db_modify_db_settings_xdist_suffix(request): | |||
skip_if_no_django() | |||
|
|||
xdist_suffix = getattr(request.config, "slaveinput", {}).get("slaveid") | |||
xdist_suffix = getattr(request.config, "workerinput", {}).get("workerid") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't followed the slave/worker work, but is it safe to just switch, or should we keep compatibility with the old names for a while? I.e. like this:
xdist_suffix = getattr(request.config, "workerinput", {}).get("workerid") | |
workerinput = getattr(request.config, "workerinput", getattr(request.config, "slaveinput", {})) | |
xdist_suffix = workerinput.get("workerid", workerinput.get("slaveid")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytest-cov switched wholesale, so I think pytest-django should too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, looks like it should be fine from the graph provided in pytest-dev/pytest-cov#412 (comment).
Wait for a new pytest-django release, which supports pytest-xdist~=2.0 as per pytest-dev/pytest-django#861
Fixes #860