# test1.py
import pytest
@pytest.mark.dependency()
@pytest.mark.xfail(reason="deliberate fail")
def test_a():
assert False
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency(depends=["test_a"])
def test_c():
pass
@pytest.mark.dependency(depends=["test_b"])
def test_d():
pass
@pytest.mark.dependency(depends=["test_b", "test_c"])
def test_e():
pass
test_d
,直接跳过了test_d
依赖test_b
,如果test_b
不通过,那么test_d
通过是正常的单独运行test_b
是可以通过的
不知道为何单独运行test_d
就会跳过了