0

I am trying to execute multiple pytest suites at a time i.e parallel execution using pytest-xdist package using pytest.

For example, I've two test suites

  1. test_one.py
  2. test_two.py

pytest test_one.py test_two.py -n 2

However, this is randomly reordering my tests in both test_one.py and test_two.py and running tests. Is there any way such that both tests suites run parallely but tests inside each suite in sequential manner ?

  • Based on [how pytest-xdist assigns tests](https://github.com/pytest-dev/pytest-xdist/blob/master/OVERVIEW.md) I think this would be 'interestingly non-trivial'. But I could be wrong; bookmarking this question – 2e0byo Sep 29 '21 at 13:16
  • Not *exactly* what you're looking for, but `--dist loadscope` or `--dist loadfile` might be close enough. Why exactly does the order matter (other than neatness?) – 2e0byo Sep 29 '21 at 13:17
  • 1
    --dist loadfile works . Thanks . – user17034571 Sep 29 '21 at 14:09

0 Answers0