python遇到AttributeError: 'str' object has no attribute '_getAssertEqualityFunc'问题解决过程
2015-05-30 20:32
2727 查看
在编写python脚本过程中,引用assertEqual()时,遇到AttributeError: 'str' object has no attribute '_getAssertEqualityFunc'问题,该意思是str没有属性,查看该方法,没有问题。此时将assertEqual里的参数修改为int型的去校验,然后也提示AttributeError: 'int' object has no attribute '_getAssertEqualityFunc',所以应该是自己编写的脚本有问题,然后想到类,引用方法,此时想到定义类方法的时候,加了个@classmethod,去掉改行,校验语句self.assertEqual执行成功。
相关文章推荐
- OC视频笔记3.1(Foundation框架,NSObject里面的方法)3.2(isKindOfClass和isMemberOfClass)
- object references an unsaved transient instance - save the transient instance before flushing
- error LNK2019: 无法解析的外部符号 __imp_GetUserObjectInformationW,该符号在函数 OPENSSL_isservice 中被引用
- Android开发: JSONObject的数据解析
- [Objective-C] 类、对象和方法
- Flex中的XMLListCollection,ArrayCollection和ObjectProxy
- Objective- c浅谈对象的初始化
- WaitForSingleObject和CEvent用法
- Object-C非正式协议与正式协议的区别
- 关于IE和火狐,谷歌,Safari对Html标签Object和Embed的支持问题
- source insight支持object-c显示的设置
- NSString,NSMutableString
- Objective-C 和 Core Foundation 对象相互转换的内存管理总结
- cannot open shared object file: No such file or directory解决
- C#如何把List of Object转换成List of T具体类型
- Ljava.lang.Object; cannot be cast to com.bdqn.hibernate.entity.*
- 使用Objective-C的文档生成工具:appledoc
- Java Object类讲解 上帝类及其一些方法的分析
- 5.图片轮播器(scrollView的使用)
- 4.软件管理界面(九宫格)