Im trying to run pytests in parallel across my selenium grid using pytest-xdist. Prior to using pytest-xdist, I had one time setup being executed once before all tests even started using the pytest_sessionstart hook. It worked perfectly. It would be the first thing that ran and no tests would start until it was finished. Once I attempted to use pytest-xdist all my session scoped hooks like pytest_sessionstart and pytest_sessionfinish are being executed multiple times. What am I not understanding or doing wrong?
Asked
Active
Viewed 1,318 times
6
-
Each slave (process, client etc) has its own session, so this behavior is expected. – hoefling Feb 12 '19 at 16:38
-
@hoefling is there a way around this? I only want a one time setup – JerryBringer Feb 12 '19 at 17:08
-
3There isn't. Check out [this issue](https://github.com/pytest-dev/pytest/issues/503) for dev explanations (comments at the bottom). – hoefling Feb 12 '19 at 17:13
-
@hoefling thanks appreciate it – JerryBringer Feb 13 '19 at 14:58