diff --git a/tests/testthat/test-class-forecast-quantile.R b/tests/testthat/test-class-forecast-quantile.R index 46daaa9b..3711cf05 100644 --- a/tests/testthat/test-class-forecast-quantile.R +++ b/tests/testthat/test-class-forecast-quantile.R @@ -302,7 +302,10 @@ test_that("score() works even if only some quantiles are missing", { # asymmetric intervals asymm <- example_quantile[!quantile_level > 0.6] - metrics <- get_metrics(example_quantile) + metrics <- get_metrics( + example_quantile, + exclude = c("overprediction", "underprediction", "dispersion") + ) metrics$wis <- purrr::partial(wis, na.rm = TRUE) expect_warning( expect_warning( diff --git a/tests/testthat/test-class-forecast.R b/tests/testthat/test-class-forecast.R index 3054c3fe..74fe1972 100644 --- a/tests/testthat/test-class-forecast.R +++ b/tests/testthat/test-class-forecast.R @@ -146,11 +146,14 @@ test_that("print() works on forecast_* objects", { test_that("print() throws the expected messages", { test <- data.table::copy(example_point) class(test) <- c("point", "forecast", "data.table", "data.frame") - suppressMessages( - expect_message( - capture.output(print(test)), - "Could not determine forecast type due to error in validation." - ) + expect_warning( + suppressMessages( + expect_message( + capture.output(print(test)), + "Could not determine forecast type due to error in validation." + ) + ), + "Error in validating" ) class(test) <- c("forecast_point", "forecast") @@ -216,3 +219,4 @@ test_that("removing NA rows from data works as expected", { attributes ) }) +