Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @alexzwanenburg,
I was just trying to run through the your test suite using
pytest-xdist
to accelerate the tests by distributing them over multiple processes. I noticed that you were manually creating and trying to handle cleanup of temporary test directories. This doesn't work well with multiprocessing, since some tests were using the same manually-created test dirs and running intoPermissionErrors
when trying to delete temp files that were being accessed by another process.PyTest includes a wonderful temporary directory feature when setup and cleanup are neatly handled in the background. A big plus is that they play nicely with
pydist-xdist
- noPermissionError
s.I've taken the liberty of implementing PyTest's
tmp_path
into your test suite, replacing the manual system.If you do adopt the changes, I'd recommend merging this before merging #70 and adapting #70 to these changes along with the changes I proposed in my PR review.
Note that using
pytest-xdist
withn=14
brought the total test suite runtime down from 20:12 to 03:35!To use it yourself, all you need to do is run: