
import pytest
@pytest.mark.parametrize("x,y,z", [('1', '2', '3'), (4, 5, 6), (1, 5, 8)]) # 前面是参数,后面值
def test_pass(x, y, z):
sum = int(x) + int(y)
assert sum == int(z)
pytest -v test03.py --执行语句
欢迎分享,转载请注明来源:内存溢出

import pytest
@pytest.mark.parametrize("x,y,z", [('1', '2', '3'), (4, 5, 6), (1, 5, 8)]) # 前面是参数,后面值
def test_pass(x, y, z):
sum = int(x) + int(y)
assert sum == int(z)
pytest -v test03.py --执行语句
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)