Skip to content

Add a helper to return the names of parametrized test instances #9

@somnambWl

Description

@somnambWl

Is there a way how can I mark parametrized test so that second, dependent, test will run only if first test passed on all parameters?

import pytest
import pytest_dependency

@pytest.mark.parametrize("x", [(True),(True)])
@pytest.mark.dependency()
def test_a(x):
    if x:
        pass
    else:
        assert 0

@pytest.mark.dependency(depends=["test_a"])
def test_b():
    pass

I know that I can mark each parameter, but this would be easier if the test should pass on all parameters and there is a lot of them.

Now this passes on first two tests (i.e. test_a) and second (test_b) is skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions