目前我正在使用以下命令運行我的測試,并在測試調(diào)用期間給出超時值。去測試 myModule -run TestSanity -v --race-timeout 10hGolang 測試模塊中有沒有辦法在程序執(zhí)行期間設(shè)置它。就像是,func TestMain(m *testing.M) { // customTimeout = "10h" // m.Timeout(customTimeout) <--- Something like this code := m.Run() os.Exit(code)}
有沒有辦法動態(tài)設(shè)置測試超時值
函數(shù)式編程
2023-03-29 17:25:02