Python开发:AttributeError: 'Class_Of_LoanUseCase' object has no attribute '_type_equality_funcs'
来源:互联网 发布:保定seo公司 编辑:程序博客网 时间:2024/06/05 22:45
才接触python1个月,正在一点点学习如何写自动化脚本。今天遇到一个非常奇葩的问题:
问题的根源是这样:
脚本提取出了公共用例:下拉文本框,实际上就是抓取页面中的下拉文本值与需求要求文本值,发送给方法后,通过asserEqual比较出结果
直接在当前编写的测试类中执行,可以通过。
但是调用这个类的时候,运行公共用例中的assertEqual方法,就报错了:AttributeError: 'Class_Of_LoanUseCase' object has no attribute '_type_equality_funcs',如图
最后是通过:查看报错日志中的类,找到了case.py,出问题的这行代码
接着找到self._type_equality_funcs,如下图,找到了红框部分的内容,当时感觉是不是测试类在:set_up时,没有加入这个方法导致的?
然后,就在set_up中加入了这行代码
再次运行,就不报错了。问题虽然解决了,但是说实话,并不太明白具体是什么原因。
目前比较怀疑是我调用unittest框架方法不对,现在对这个框架还没驾轻就熟,以后如果知道原因再补充。
阅读全文
0 0
- Python开发:AttributeError: 'Class_Of_LoanUseCase' object has no attribute '_type_equality_funcs'
- python __def__ Exception AttributeError: "'NoneType' object has no attribute
- python __def__ Exception AttributeError: "'NoneType' object has no attribute
- [Python][转]Exception AttributeError: "'NoneType' object has no attribute
- Python:AttributeError: 'function' object has no attribute '_doc_'
- [Python]attributeError:'module' object has no attribute 'dump'
- [python错误]builtins.AttributeError: 'module' object has no attribute 'request'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- python AttributeError: 'module' object has no attribute 'setdefaultencoding'
- [python]Django AttributeError 'tuple' object has no attribute 'regex'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- python AttributeError: 'module' object has no attribute 'dumps'解决办法
- Python AttributeError: 'module' object has no attribute xxxx
- Python 【精】AttributeError: 'Module' object has no attribute 'STARTF_USESHOWINDOW'
- Python AttributeError: ‘module’ object has no attribute ‘A’
- AttributeError: 'module' object has no attribute 'face' 问题解决 opencv+python
- python 错误解析 AttributeError: 'module' object has no attribute 'dumps'
- 【python】AttributeError: 'module' object has no attribute 'HTTPSConnection'
- 简单搭建centos7的web服务器
- java8
- SIFT算法简介
- Vue 列表渲染性能优化原理
- MyEclipse下Maven的安装配置
- Python开发:AttributeError: 'Class_Of_LoanUseCase' object has no attribute '_type_equality_funcs'
- WP推荐插件与不推荐插件清单
- WINDOWS防火墙开启后Ping不通
- 在 Unity 中保存和载入游戏
- css实现文字内容超出显示省略号
- 算法之路之征服上海交大的oj- 数独
- 绝地求生大逃杀DLL140dll出错怎么办?
- maven-assembly-plugin打Jar 出现异常
- 安装composer后报错proc_open(): fork failed