unittest 中的方法调用时报错 ValueError: no such test method in <class 'mytestcase.MyTestCase'>: runTest

1、调用unittest中的方法时报错:

  • ValueError: no such test method in <class 'mytestcase.MyTestCase'>: runTest
  • 原因是因为 sub_class 里缺少 runTest 方法
  • 直接在 testA 的类中增加
def runTest(self):
    pass

 

posted @ 2019-10-18 10:27  Evan0813  阅读(1194)  评论(0)    收藏  举报