pytest configure upfront before running in parallel with xdist

Viewed 2563

I just started to use pytest in combination with xdist to run tests in parallel. I my contest.py I have a configure hook to create some test data direcories (with a time stamp) and files I need for my test run. All works fine until I use xdist. It looks like that pytest_configure is executed first and then again for each process again resulting in:

INTERNALERROR> OSError: [Errno 17] File exists: '/path/to/file'

And I end up with n+1 directories (a couple of seconds away). Is there a way to configure the test run upfront before distributing?

Edit: I might have found a solution to my problem here. I still need to test it though.

1 Answers
Related