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

Use pytest-xdist #440

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Use pytest-xdist #440

merged 2 commits into from
Sep 25, 2023

Conversation

mdbenito
Copy link
Collaborator

@mdbenito mdbenito commented Sep 22, 2023

Description

This PR makes our lives nicer by using pytest-xdist. We automagically set the number of pytest workers to avoid oversubscription by looking at num_workers (the number of parallel processes started within a test using a parallel backend)

Changes

  • Required pytest-xdist
  • Made num_workers not a fixture
  • Used -n auto in calls to pytest inside tox.ini

Checklist

  • Wrote Unit tests (if necessary)
  • Updated Documentation (if necessary)
  • Updated Changelog
  • If notebooks were added/changed, added boilerplate cells are tagged with "tags": ["hide"] or "tags": ["hide-input"]

@mdbenito mdbenito marked this pull request as ready for review September 22, 2023 20:58
@mdbenito mdbenito assigned mdbenito and AnesBenmerzoug and unassigned mdbenito Sep 22, 2023
@AnesBenmerzoug
Copy link
Collaborator

This doesn't seem to improve the test runtime on CI. Is that expected?

@mdbenito mdbenito merged commit 3d0e579 into develop Sep 25, 2023
12 checks passed
@mdbenito mdbenito deleted the feature/pytest-xdist branch September 25, 2023 09:40
@mdbenito
Copy link
Collaborator Author

This doesn't seem to improve the test runtime on CI. Is that expected?

For the record: yes, this only improves tests on machines with > 4 cores.

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.

None yet

2 participants