【拉勾6期】python pytest 测试实战

老师请查收:
https://github.com/wy142222/pytest_exercise/blob/master/testcase/testcase1.py

请老师查收:https://github.com/chen-xq-417/homework3/tree/main/python_calc

交作业,请老师查收

另外想请教一点,当yaml文件中含有加减乘除等不同method需要的数据时,该如何利用@pytest.fixture函数来导入呢?
我想到的是用多个fixture函数来实现,像下面这样。不知道还有更好的方法没有,请老师和同学们赐教。

# 从yaml文件中读取测试数据
with open('../data/calc.yaml') as f:
    param_data = yaml.safe_load(f)
    add = param_data['add']
    add_data = add['data']
    add_ids = add['ids']
    sub = param_data['sub']
    sub_data = sub['data']
    sub_ids = sub['ids']
<...>

# 创建加法的fixture函数
@pytest.fixture(params=add_data, ids=add_ids)
def get_add_data(request):
    data = request.param
    yield data

# 创建减法的fixture函数
@pytest.fixture(params=sub_data, ids=sub_ids)
def get_sub_data(request):
    data = request.param
    yield data
<...>

老师好:作业请查收
https://github.com/hanjj01/homework-4

https://github.com/xingxiaolei/HogwartsHomework/tree/master/calc_update

https://github.com/nalidenaidoubao/-2 老师请查收

老师请查收:

https://github.com/Kidmytalent/Pytest_phase4_homework_calculator

老师请查收:
https://github.com/yuwenli/hogwarts_yuwenli/tree/master/hogwarts_practices/python_calcu2

https://github.com/luoluoxx0115/pytest_9916.git

作业链接:works: homework

请查收

老师请查收作业:https://github.com/qw20140729/lagou6/tree/main/tasks/pratice_4

老师请查收:
备注名称为:“python pytest 测试实战" “allure报告” 的文件为这次作业:

https://github.com/qkwlqkwl/homework2/tree/master/testing

https://github.com/chh08/calc_home
请老师查收

飞儿老师好,作业请查收:
https://github.com/Xylon4/-/tree/master/homework/210129[作业地址]

老师请查收
https://github.com/fatfatfatFatTiger/HogwartsLG6.git

老师请查收:https://github.com/ZhouGuoMing/stagefour

请老师检查“pytest 实战作业”:https://github.com/Abigail2020/python

老师好,作业已提交,请查收:https://github.com/newcoder-li/pytesthomework.git