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

Dependency between two tests

Open jcalienni opened this issue 3 years ago • 1 comments

Hello, i have a question: Is it possible to add dependency with two tests but exclusive? Let me explain my self: With this line "@pytest.mark.dependency(depends=["test_b", "test_c"])", both test_b and test_c should pass for the test to run. What i want to do is if at least one of the tests pass the test should run. So if test_b pass and test_c fails it should run anyways. The only way the test shouldn't run if both tests fails. image

I know this questions migth seem a bit rare, but i'm trying to create a workaroun since i'm running parallel tests with xdist and i think this would help me.

jcalienni avatar Jul 29 '21 13:07 jcalienni

Apologies for not replying earlier. What you ask for is not supported out of the box in pytest-dependency. But you can implement it using a small helper function. I provided an example in #57.

RKrahl avatar Dec 24 '21 16:12 RKrahl