若出现以下报错信息:
Traceback (most recent call last):
File "C:\Python34\lib\unittest\case.py", line 372, in __init__
testMethod = getattr(self, methodName)
AttributeError: 'ProductCases' object has no attribute 'test_product_add'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\bSoftware\pycharm\PyCharm Community Edition 2016.3.3\helpers\pycharm\utrunner.py", line 181, in <module>
all.addTest(testCaseClass(a[2]))
File "C:\Python34\lib\unittest\case.py", line 378, in __init__
(self.__class__, methodName))
ValueError: no such test method in <class 'autoRanzhi.unit_test.productTest.ProductCases'>: test_product_add
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\bSoftware\pycharm\PyCharm Community Edition 2016.3.3\helpers\pycharm\utrunner.py", line 185, in <module>
testLoader.makeTest(getattr(testCaseClass, a[2]), testCaseClass))
AttributeError: 'TestLoader' object has no attribute 'makeTest'
Process finished with exit code 1
你只需要,在单元测试框架外运行就好了。