为什么不运行unittest测试用例

时间:2018-01-27 18:25:56

标签: python

我有以下curl --anyauth --user public\admin:admin -X GET -i \ -H "Accept: application/xquery" \ http://localhost:9963/v1/config/transforms/rest-tsm 测试用例:

unittest

我从命令行import unittest from ElementExtractor import ElementExtractor class ElementExtractorTest(unittest.TestCase): def allListsHaveSameSize(self): self.assertTrue(1 == 2) if __name__ == '__main__': unittest.main() 运行它,我得到了这个输出:

python ElementExtractorTest.py

为什么单元测试没有运行? 我怎样才能让它运行?

1 个答案:

答案 0 :(得分:0)

import unittest
from ElementExtractor import ElementExtractor

class ElementExtractorTest(unittest.TestCase):
    def test_allListsHaveSameSize(self): #add test here to be picked up
        self.assertTrue(1 == 2)

if __name__ == '__main__':
    unittest.main()