nose-parameterized

软件截图:
nose-parameterized
软件详细信息:
版本: 0.3.1
上传日期: 14 Apr 15
开发: David Wolever
许可: 免费
人气: 3

Rating: 3.0/5 (Total Votes: 1)

鼻patameterized是一个装饰的参数测试与鼻子。
鼻子。它有测试发生器。但他们那种吸,这是因为:
- 它们往往需要一个第二函数
- 它们使得难以将数据从测试分离
- 它们不与unittest.TestCase的的subclases工作
但鼻参数修补程序。
看看这个:
 猫test_math.py
从nose.tools进口assert_equal
从nose_parameterized进口参数
进口单元测试
进口数学
@Parameterized([
 (2,2,4),
 (2,3,8),
 (1,9,1),
 (0,9,0),
])
高清test_pow(基地,指数,预期):
  assert_equal(math.pow(基地,指数),预期)
类TestMathUnitTest(unittest.TestCase的):
  @ parameterized.expand([
 ( - 1.5,-2.0)
 (1.0,1.0),
 (1.6,1),
 ])
 高清test_floor(自行输入,拼音):
  assert_equal(math.floor(输入),预期)
$ nosetests -v test_math.py
test_math.test_pow(2,2,4)... OK
test_math.test_pow(2,3,8)... OK
test_math.test_pow(1,9,1)... OK
test_math.test_pow(0,9,0)... OK
test_floor_0(test_math.TestMathUnitTest)... OK
test_floor_1(test_math.TestMathUnitTest)... OK
test_floor_2(test_math.TestMathUnitTest)... OK
-------------------------------------------------- --------------------
在0.002s跑了7测试
OK

要求

  • 在Python中
  • 在鼻子

类似的软件

STK/Unit
STK/Unit

20 Feb 15

pry
pry

14 Apr 15

Sonar
Sonar

11 May 15

意见 nose-parameterized

评论没有发现
添加评论
打开图片!