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 into PermissionErrors 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 - no PermissionErrors.
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 with n=14 brought the total test suite runtime down from 20:12 to 03:35!
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: