unittest 'module' object has no attribute 'TestCase'--自己坑自己
来源:互联网 发布:腾讯官网软件下载 编辑:程序博客网 时间:2024/05/21 10:20
早上使用python的unittest这个框架
class TestFuc(unittest.TestCase):定义了一个类TestFuc,但是运行后提示unittest中没有TestCase
尝试了各种testcase的拼写方式,仍然有这个提示,最后发现居然自己有一个.py文件的名字就是unittest,刚好与python中自带的unittest重名了,错误信息的意思其实是我自己写的那个unittest中没有testcase这个方法。
将自己这个文件的名字修改后,运行通过。
自己坑了自己
将自己这个文件的名字修改后,运行通过。
自己坑了自己
0 0
- unittest 'module' object has no attribute 'TestCase'--自己坑自己
- AttributeError: 'module' object has no attribute 'getpass'
- 'module' object has no attribute 'basicConfig'
- AttributeError: 'module' object has no attribute 'Serial'
- 'module' object has no attribute 'rindex'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- Django: 'module' object has no attribute 'index'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- AttributeError: ‘module’ object has no attribute’xxx’
- AttributeError: ‘module’ object has no attribute’ 问题
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- AttributeError: 'module' object has no attribute 'AF_INET'
- Linux之getopt
- mysql数据的备份恢复和还原
- Xcode真机调试常碰到的问题
- javascript库之Mustache库使用说明
- Android自定义控件——FloatLayout
- unittest 'module' object has no attribute 'TestCase'--自己坑自己
- Openwrt UCI API的使用
- android系统简介
- mysql高可用浅析
- LINUX下动态库调用静态库的方法
- 表层+深层
- JVM原理及底层探索
- rk3288 编写Android.mk 形式内置APK
- local storage (H5本地存储)