0
我有一個python函數somefunc(),它必須返回一個像這樣的數組。[1, 2, 3]
。現在我正在寫一個單元測試來檢查一下這個函數返回:單元測試(Python),測試函數是否返回數組
class TestingFunctionsTest(unittest.TestCase):
def test_somefunc(self):
#what to write here ?
我在Python測試新的,請幫助。
非常感謝,你能告訴如何檢查函數是否返回整數例如?或者,如果可以的話,給一些鏈接說明如何使用assertEqual()? – user3057314
@ user3057314你可以參考http://stackoverflow.com/q/3371255/1265154 – alko