1
動態測試我有,所以我想使用循環 我會嘗試像測試的動態量:鼻子產生與裝飾
from nose.tools import istest, nottest
from nose.tools import eq_
import nose
nose.run()
@istest
def test_1():
for i in range(100):
@istest
def test_1_1():
eq_(randint(1,1),1)
---------------------
Ran 1 test in 0.001s
OK
但鼻子顯示它像只有一個測試。我如何將它改進到100次測試? 在此先感謝。
謝謝! 但對於我來說,仍然不清楚如何使用「for」循環。 –
因爲你不用for循環 - 這不是接口。讓裝飾者爲你做循環,它更好。 – wim