Skip to content

Commit

Permalink
improve testing output
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Oct 10, 2023
1 parent 9b30403 commit 3a05c06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 2 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
library("data.table")

if (identical(Sys.getenv("NOT_CRAN"), "true")) {
files <- c(
"convolve.stan", "pmfs.stan", "observation_model.stan", "secondary.stan",
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-estimate_secondary.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
skip_on_cran()
library(data.table)

#### Incidence data example ####

Expand Down
12 changes: 4 additions & 8 deletions tests/testthat/test-estimate_truncation.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ test_that("estimate_truncation can return values from simulated data and plot
them", {
# fit model to example data
est <- estimate_truncation(example_data,
verbose = interactive(), refresh = 0,
chains = 2, iter = 1000, warmup = 250
verbose = FALSE, chains = 2, iter = 1000, warmup = 250
)
expect_equal(
names(est),
Expand All @@ -58,16 +57,13 @@ test_that("estimate_truncation can return values from simulated data and plot
test_that("deprecated arguments are recognised", {
options(warn = 2)
expect_error(estimate_truncation(example_data,
verbose = interactive(), refresh = 0,
trunc_max = 10
verbose = FALSE, trunc_max = 10
), "deprecated")
expect_error(estimate_truncation(example_data,
verbose = interactive(), refresh = 0,
max_truncation = 10
verbose = FALSE, max_truncation = 10
), "deprecated")
expect_error(estimate_truncation(example_data,
verbose = interactive(), refresh = 0,
trunc_dist = "lognormal"
verbose = FALSE, trunc_dist = "lognormal"
), "deprecated")
})

Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-simulate_infections.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ reporting_delay <- dist_spec(
sd = convert_to_logsd(2, 1), sd_sd = 0.1, max = 10
)

library(data.table)
out <- suppressWarnings(estimate_infections(reported_cases,
generation_time = generation_time_opts(generation_time),
delays = delay_opts(reporting_delay),
Expand Down

0 comments on commit 3a05c06

Please sign in to comment.