场景: 我的一个测试用例是用几个输入文件和一个特定的输出执行一个shell程序。我想测试这些输入/输出的不同变体,每个变体都保存在自己的文件夹中,即文件夹结构
/testA
/testA/inputX
/testA/inputY
/testA/expected.out
/testB
/testB/inputX
/testB/inputY
/testB/expected.out
/testC/
...
以下是我运行此测试的代码:
^{pr2}$本例中的testname是“testX”。它使用该文件夹中的inputs
执行外部程序,并将其与同一文件夹中的expected.out
进行比较。在
问题: 一旦测试失败,测试就会停止并得到:
Could not find or read expected output file: C:/PROJECTS/active/CMDR-Test/data/test_freeTransactional/expected.out
======================================================================
FAIL: test_folders (cmdr-test.TestValidTypes)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\PROJECTS\active\CMDR-Test\cmdr-test.py", line 52, in test_folders
self.assertTrue(self.runTest(testname))
AssertionError: False is not true
问题: 我如何让它继续剩下的测试并显示有多少测试失败? (本质上是动态地创建一个unittest并执行它)
谢谢
这样的怎么样?在
相关问题 更多 >
编程相关推荐