【发布时间】:2010-02-03 23:44:39
【问题描述】:
我需要为一些 python 类创建一个单元测试。我有一个输入和预期结果的数据库,应该由 UUT 为这些输入生成。
这是我想做的伪代码:
for i=1 to NUM_TEST_CASES:
Load input for test case i
execute UUT on the input and save output of run
Load expected result for test case i
Compare output of run with the expected result
我可以使用 unittest 包来实现这一点,还是有一些更好的测试包用于此目的?
【问题讨论】:
-
为了澄清你的问题,你的意思是像 PHPUnit 中的数据提供者吗? phpunit.de/manual/current/en/…
标签: python unit-testing