Skip to content

Commit

Permalink
Replace |> with %>% in tests to prevent them from failing with R 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse committed Nov 20, 2023
1 parent 32d8c2d commit fbcf6f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-plot_interval_coverage.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("plot_interval_coverage() works as expected", {
coverage <- add_coverage(example_quantile) |>
coverage <- add_coverage(example_quantile) %>%
summarise_scores(by = c("model", "range"))
p <- plot_interval_coverage(coverage)
expect_s3_class(p, "ggplot")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot_quantile_coverage.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("plot_quantile_coverage() works as expected", {
coverage <- add_coverage(example_quantile) |>
coverage <- add_coverage(example_quantile) %>%
summarise_scores(by = c("model", "quantile"))

p <- plot_quantile_coverage(coverage)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-plot_ranges.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
m <- modifyList(metrics_no_cov_no_ae, list("bias" = NULL))

sum_scores <- copy(example_quantile) %>%
.[, interval_range := scoringutils:::get_range_from_quantile(quantile)] |>
score(metrics = m) |>
.[, interval_range := scoringutils:::get_range_from_quantile(quantile)] %>%
score(metrics = m) %>%
summarise_scores(by = c("model", "target_type", "interval_range"))

sum_scores[, range := interval_range]
Expand Down

0 comments on commit fbcf6f1

Please sign in to comment.