Skip to content
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

Merged
merged 1 commit into from Aug 16, 2020
Merged

support pytest-xdist 2 #861

merged 1 commit into from Aug 16, 2020

Conversation

graingert
Copy link
Member

@graingert graingert commented Aug 16, 2020

Fixes #860

@@ -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")
Copy link
Member

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:

Suggested change
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"))

Copy link
Member Author

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

Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicate key value violates unique constraint "pg_extension_name_index" after update pytest-xdist to 2.0.0
3 participants