Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse committed Sep 25, 2024
1 parent 8b776d8 commit 405cc52
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tests/testthat/test-metrics-quantile.R
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ test_that("interval_coverage rejects wrong inputs", {
test_that("interval_coverage_quantile throws a warning when a required quantile is not available", {
dropped_quantile_pred <- predicted[, -4]
dropped_quantiles <- quantile_level[-4]
expect_warning(
expect_error(
interval_coverage(
observed, dropped_quantile_pred, dropped_quantiles, interval_range = 50
),
Expand All @@ -686,7 +686,7 @@ test_that("interval_coverage_deviation works", {
interval_coverage_deviation(observed, predicted, quantile_level),
manual
)
expect_warning(
expect_error(
interval_coverage_deviation(
observed, predicted, c(quantile_level[-4], 0.76)
),
Expand Down Expand Up @@ -945,16 +945,10 @@ test_that("ae_median_quantile() works as_expected", {
)

# test that we get a warning if there are inputs without a 0.5 quantile
expect_warning(
expect_equal(
ae_median_quantile(observed, predicted_values, quantile_level = 0.6),
NA_real_
),
'In order to compute the absolute error of the median, "0.5" must be among the quantiles given.'
expect_error(
ae_median_quantile(observed, predicted_values, quantile_level = 0.6),
'In order to compute the absolute error of the median, '
)


dim(1:10)
})


Expand Down

0 comments on commit 405cc52

Please sign in to comment.