pytest-split icon indicating copy to clipboard operation
pytest-split copied to clipboard

compatibility with pytest-dependency

Open Mystorius opened this issue 1 year ago • 5 comments

Hi,

first: thank you for the cool tool, it really helps with faster CI pipelines :)

My request: can you make the split algorithm take pytest dependencys into account? We have same test that depend on other test to run first. Currently pytest splits theses into different groups which will result in the tests failing.

Mystorius avatar Jun 19 '23 20:06 Mystorius

Hi! Interesting use case 🤔 How do you ensure they run in correct order without using pytest-split? Are the tests which depend on each other within the same module or even within the same class?

If you could move the dependencies into fixtures, that would probably solve the issue without needing to change how pytest-split behaves. If that's out of question, I guess one option could be to introduce some CLI options to pytest-split for not splitting test modules / classes.

jerry-git avatar Jun 20 '23 08:06 jerry-git

Sorry, I think I misread initially. So, you are basically asking if pytest-split could be made compatible with https://pypi.org/project/pytest-dependency/?

jerry-git avatar Jun 20 '23 12:06 jerry-git

Yes, was just about to post that we use pytest-dependency But I didn't know that pytest-split is compatible with fixtures already. Maybe it would be worth it to refactor our tests into fixtures then as pytest-dependency seems to be out of date anyways.

Mystorius avatar Jun 20 '23 12:06 Mystorius

Maybe it would be worth it to refactor our tests into fixtures

Great! I hope it works out nicely for you 🙂

jerry-git avatar Jun 22 '23 11:06 jerry-git