【拉勾三期】python pytest 测试实战1

加法/除法测试py文件在:pytest/test_calc_pytest.py
yaml数据文件在:pytest/data/calc.yml

https://github.com/niujiama/LilyGithub.git

作业完成 的不错,思路很完整。
用例设计的再全面一些。

作业完成的不错,思路很清晰。
一些需要注意的小问题:
1、目录结构划分一下,更便于维护。
2、除法分母为0的情况,如果抛出ZeroDivisionError 异常,说明是正确的,不需要手动再抛出异常了。

with pytest.raises(ZeroDivisionError) as exc_info:
                calc_result = self.calc.divide(a, b)

pytest实战一
有个问题地方不知道怎么写,如果怎么去判断传入的参数是数值,不是字符串
https://github.com/pengxiufang/hogwarts_lg3/tree/master/python_practice

https://github.com/ygl6532/testing/tree/master/calculator

已修改

https://github.com/lh75756/python/tree/master/homework/homework_calc

https://github.com/jijiangyongyou/win_happy/tree/master/xuexi_pytest

https://github.com/Vena-ww/MyPythonTest

https://github.com/zhaoxiaoshan405671811/hogwarts_demo/tree/master/Python_demo/demo_pytest

https://github.com/Lannal/pythonProject.git

https://github.com/youthtail/hogwarts_yhh/blob/master/pytest_2/test_practice3.py

  • pytest实战一,计算器加法、除法单元测试

https://github.com/LiJiaLin29/hogwarts

https://github.com/xiaomaolv60/python_practise.git

https://github.com/sunybee/homework3

https://github.com/he56jian/hgwz_test

https://github.com/gqxjones/MyprojectHogwarts/blob/master/testing/pytest.py

https://github.com/zz06212github/hogwarts_lun

https://github.com/a18280102190/Test_two.git

https://github.com/Frame-heye/TestDevelopmentLearning/tree/master/ForthModule
pytest第一次作业