Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with pytest-dependency #75

Open
Mystorius opened this issue Jun 19, 2023 · 5 comments
Open

compatibility with pytest-dependency #75

Mystorius opened this issue Jun 19, 2023 · 5 comments

Comments

@Mystorius
Copy link

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.

@jerry-git
Copy link
Owner

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
Copy link
Owner

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/?

@Mystorius
Copy link
Author

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.

@jerry-git
Copy link
Owner

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

Great! I hope it works out nicely for you 🙂

@zeevikn-oe
Copy link

@jerry-git
Hi.
First, thanks for this pytest addition. It looks awesome.
You mention here that using fixture can help group tests together (which is what currently blocking us from splitting our tests), but I did not find any reference to it in the repo.
Internal reasons requires some tests to be grouped together (ordering in the group can be random)
I'd be happy if you could point/elaborate how we can use fixtures to force tests into the same group.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants