From b79db53b1e03a545939e5ee4a6f4168fe4e00e81 Mon Sep 17 00:00:00 2001 From: David Klein Date: Thu, 10 Oct 2024 14:36:13 +0200 Subject: [PATCH] Use capture_warnings instead of capture_warning, the latter of which wouldnt let updateInputData finish properly --- tests/testthat/test_01-inputdata.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test_01-inputdata.R b/tests/testthat/test_01-inputdata.R index 40911680d..f3c174b18 100644 --- a/tests/testthat/test_01-inputdata.R +++ b/tests/testthat/test_01-inputdata.R @@ -8,10 +8,10 @@ test_that("Are all input data files present?", { missinginput <- missingInputData(path = "../..") if (length(missinginput) > 0) { lockID <- gms::model_lock(folder = "../..") - w <- capture_warning(updateInputData(cfg = gms::readDefaultConfig("../.."), remindPath = "../..")) + w <- capture_warnings(updateInputData(cfg = gms::readDefaultConfig("../.."), remindPath = "../..")) # ignore warning about missing historical.mif, raise warning if there were other wargnings ignore <- "File historical.mif seems to be missing!" - if (!w$message %in% ignore) { + if (!w %in% ignore) { warning(paste0("'updateInputData' raised the following wargnings\n", paste(w, collapse = "\n"))) } gms::model_unlock(lockID)