Skip to content

Commit

Permalink
Use capture_warnings instead of capture_warning, the latter of which …
Browse files Browse the repository at this point in the history
…wouldnt let updateInputData finish properly
  • Loading branch information
dklein-pik committed Oct 10, 2024
1 parent b1ae937 commit b79db53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test_01-inputdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b79db53

Please sign in to comment.