pytest-dependency
pytest-dependency copied to clipboard
Dependency between two tests
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.
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.
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.