kevlened / pytest-parallel

A pytest plugin for parallel and concurrent testing
https://github.com/browsertron/pytest-parallel/issues/104#issuecomment-1293941066
MIT License
313 stars 60 forks source link

Add environment variable with index of process/thread #73

Open maxmcd opened 4 years ago

maxmcd commented 4 years ago

pytest-xdist has PYTEST_XDIST_WORKER which we use to create a unique DB for each thread. Could pytest-parallel provide something similar?

Happy to work on this if there is interest

maxmcd commented 4 years ago

Added this: https://github.com/voltusdev/pytest-parallel/commit/868f69dcb1f80ec4e7c3d4030195d0e9a224419e

Strangely, the value stored in this variable disappears near the end of the test run. Not sure if that's due to an issue with this implementation or something else in my environment.