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

Allow non-threadsafe projects to be compatible with --tests-per-worker=1 #79

Open bukzor opened 4 years ago

bukzor commented 4 years ago

I could instead add a more explicit --nothreading option, if you prefer, but this patch makes pytest-parallel a drop-in replacement for pytest-xdist (if you added -n as an alias for --workers), which is what we're using it as.

Even better would be to have the first "thread" of each process run in the main thread, and send anything marked with pytest.mark.threadunsafe to only main-thread workers. But that's a ton more work.