在conftest @pytest.fixture 写公共的前置条件(相当于setup tearDown)
调用pytest
1. @pytest.mark.usefixtures("函数名") 放测试用例或类前面
2.不管有没有返回值,都要,将函数名作为测试用例的参数
如果它有返回值则它代表@pytest.fixture的返回值,需要的返回值写在 yield 后面(返回值)
3.断言是assert 后面跟表达式
在conftest @pytest.fixture 写公共的前置条件(相当于setup tearDown)
调用pytest
1. @pytest.mark.usefixtures("函数名") 放测试用例或类前面
2.不管有没有返回值,都要,将函数名作为测试用例的参数
如果它有返回值则它代表@pytest.fixture的返回值,需要的返回值写在 yield 后面(返回值)
3.断言是assert 后面跟表达式