Доброго времени суток.
Подскажите, есть возможность распределять направления между воркерами, при параллельном запуске тестирования, используя pytest?
Например:
first/
test_1.py
test_2.py
test_3.py
second/
test_1.py
test_2.py
test_3.py
Суть в том, что я хочу запустить одновременно тесты из директории first и second в 2 потока, да так, чтоб они друг другу не мешали. В идеале конечно, чтоб каждый процесс выполнял свою работу только из своей директории.
[gw0] == first/..
[gw1] == second/..
Возможно ли это реализовать как-то, используя pytest-xdist? Либо я тупой(большая вероятность), либо в оф. документации нет об этом информации
By default, using --numprocesses will send pending tests to any worker that is available, without any guaranteed order. You can change the test distribution algorithm this with the --dist option. It takes these values:
--dist no: The default algorithm, distributing one test at a time.
--dist loadscope: Tests are grouped by module for test functions and by class for test methods. Groups are distributed to available workers as whole units. This guarantees that all tests in a group run in the same process. This can be useful if you have expensive module-level or class-level fixtures. Grouping by class takes priority over grouping by module.
--dist loadfile: Tests are grouped by their containing file. Groups are distributed to available workers as whole units. This guarantees that all tests in a file run in the same worker.