-
Notifications
You must be signed in to change notification settings - Fork 13
enable parallel testing using pytest-xdist #190
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
Conversation
870b857 to
484a318
Compare
0ea4383 to
1e237aa
Compare
484a318 to
dbaeb31
Compare
1e237aa to
9e5f322
Compare
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.
Just for me to understand, reading from the docs, pytest-xdist can be used in cases a fixture needs to execute exactly once per test session, for example specifying scope="session" in the fixture and by reading from a FileLock to produce the fixture data only once. I don't see here any .lock file though. So I wonder how the tests can run in parallel with the current edits.
dbaeb31 to
ac9005c
Compare
9e5f322 to
ff3f31e
Compare
We solved the issue in a different way. See the example below: We used So for the example below,
|
ac9005c to
eedc800
Compare
ff3f31e to
9163671
Compare
Merge activity
|
|
@florian-huber we could consider using this also for matchms to speed up test execution |
This PR adds the pytest-xdist to enable parallel testing to speed up the testing.
To make parallel testing work, some session-scoped pytest fixtures that generate data or files used by multiple test files were updated (see this example).
Results:
Using
pytest --durations=0can detect the most time consuming tests. It shows that tests on downloaders are most expensive, and ignoring them can reduce testing time from 85s to 15s!