@pytest.mark.parametrize
@pytest.mark.parametrize("test_input,expected", [("3+5", 8), ("2+4", 6), ("6...test
重叠产生笛卡尔积
import pytest @pytest.mark.parametrize("x", [0, 1]) @pytest.mark.parametrize("y",...import pytest
@pytest.mark.parametrize(
"test_input,expected",
[("3+5", 8), ("2+4", 6), pytest.param...我的做法是,把接口请求全部参数化了,test函数里面只有断言,伪代码大致如下
def api():
params = []
def func():
return request...(ZeroDivisionError):
a / b
8.在不同python解释器之间测试对象序列化。