I am using pytest-xdist to parallelize my tests. The machine I am working on has 12 cores. Half of my tests use 2 processes in each test, while the other half of the tests only use one process (normal single processing).
Currently I add the addopts = -n6 to my pytest.init file, since some tests actually require two processes (6 * 2 = 12, or all the available cores on my machine). I was wondering if it's possible to specify the amount of cores each test uses?
For example, all tests that use 2 processes I would mark it that way, and pytest-xdist would ideally know to take up 2 processes from it's pool of workers for those tests. Then I can change my pytest.ini to include addopts = -n12? I could not figure out how to do it from reading the documentation, maybe it's not possible.
Thanks so much!