![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
unittest
chde2Wang
滴水穿石
展开
-
unittest-常见问题解决方案记录
1、没有报错,但显示run 0 tests 解决方案:查看测试用例是否以test开头 2、命名为test-01,导包错误 解决方案:python文件夹命名不能使用中划线,修改中划线为下划线,即可导包正确。原创 2021-11-09 23:38:49 · 514 阅读 · 0 评论 -
练习ddt-file_data时,报错UnboundLocalError local variable ‘value‘ referenced before assignment
错误原因就是,在xx.yml中的内容无效 更改之前: 更改之后: 注意冒号后面要有空格 改完之后运行就能正确读取到了原创 2021-08-12 23:20:12 · 157 阅读 · 0 评论 -
unittest-ddt报错AttributeError: type object ‘forTestDDT‘ has no attribute ‘test_2‘
unittest 添加多个ddt数据驱动后,报错: FAILED (errors=1) Error Traceback (most recent call last): File "D:\Anaconda3\lib\unittest\case.py", line 60, in testPartExecutor yield File "D:\Anaconda3\lib\unittest\case.py", line 676, in run self._callTestMethod转载 2021-08-12 22:33:42 · 976 阅读 · 0 评论