比方說,我有這方面的測試功能: def test_function_one():
assert # etc...
def test_function_two():
# should only run if test_function_one passes
assert # etc.
我怎樣才能確保test_function_two只有test_function
我使用了一組python單元測試,這些測試目前使用構建在測試框架中的pythons來構建。我想編寫基於我提供的數據集執行多次的參數化測試。 即。如果我的數據集是[1,2,3,4],我的測試函數將使用我的數據集中的輸入運行四次。 def test(data):
if data > 0:
#Pass the test
從我的理解,目前在內置框架中是不可能的,除非我在我的測試函