From d93a53e28286ea83b5c413204146a1c2eb2b5ab3 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Sun, 15 Oct 2023 21:03:48 +0100 Subject: [PATCH] update tests --- tests/testthat/setup.R | 1 + tests/testthat/test-delays.R | 20 ++------------------ tests/testthat/test-report_cases.R | 2 +- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index b10a5bffa..ce0ed932d 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -1,4 +1,5 @@ library("data.table") +library("lifecycle") if (identical(Sys.getenv("NOT_CRAN"), "true")) { files <- c( diff --git a/tests/testthat/test-delays.R b/tests/testthat/test-delays.R index dd1ba768d..e7daddf7e 100644 --- a/tests/testthat/test-delays.R +++ b/tests/testthat/test-delays.R @@ -83,6 +83,7 @@ test_that("contradictory delays are caught", { }) test_that("deprecated arguments are caught", { + options(lifecycle_verbosity = "warning") expect_warning( test_stan_delays( generation_time = generation_time_opts(mean = 3), @@ -113,22 +114,5 @@ test_that("deprecated arguments are caught", { params = delay_params ), "deprecated" ) - expect_warning( - test_stan_delays( - generation_time = generation_time_opts( - get_generation_time( - disease = "SARS-CoV-2", source = "ganyani", - ) - ), - ), "deprecated" - ) - expect_warning( - test_stan_delays( - delays = delay_opts( - get_incubation_period( - disease = "SARS-CoV-2", source = "lauer" - ) - ), - ), "deprecated" - ) + options(lifecycle_verbosity = NULL) }) diff --git a/tests/testthat/test-report_cases.R b/tests/testthat/test-report_cases.R index 0e67502e9..2e91f3053 100644 --- a/tests/testthat/test-report_cases.R +++ b/tests/testthat/test-report_cases.R @@ -20,6 +20,6 @@ test_that("report_cases can simulate infections forward", { expect_equal(class(reported_cases), "list") expect_equal(class(reported_cases$samples), c("data.table", "data.frame")) expect_equal(class(reported_cases$summarised), c("data.table", "data.frame")) - expect_equal(nrow(reported_cases$summarised), 9) + expect_equal(nrow(reported_cases$summarised), 10) expect_equal(class(reported_cases$summarised$median), "numeric") })