Skip to content

Commit acc3577

Browse files
committed
suppress more output during tests to clean up logs
1 parent 591b4ab commit acc3577

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

tests/testthat/test-failed-chains.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,12 @@ test_that("gq chains error on wrong input CSV", {
179179
mod <- testing_model("bernoulli_ppc")
180180
data_list <- testing_data("bernoulli_ppc")
181181
suppressWarnings(
182-
expect_message(
183-
mod$generate_quantities(data = data_list, fitted_params = fit_logistic$output_files()),
184-
"Mismatch between model and fitted_parameters csv"
182+
expect_output(
183+
expect_message(
184+
mod$generate_quantities(data = data_list, fitted_params = fit_logistic$output_files()),
185+
"Mismatch between model and fitted_parameters csv"
186+
),
187+
"Running standalone generated quantities"
185188
)
186189
)
187190
expect_warning(

tests/testthat/test-fit-mcmc.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ test_that("loo method works with moment-matching", {
285285
# Moment-matching needs model-methods, so make sure hpp is available
286286
mod <- cmdstan_model(testing_stan_file("loo_moment_match"), force_recompile = TRUE)
287287
data_list <- testing_data("loo_moment_match")
288-
fit <- mod$sample(data = data_list, chains = 1, seed = 1000)
288+
utils::capture.output(
289+
fit <- mod$sample(data = data_list, chains = 1, seed = 1000)
290+
)
289291

290292
# Regular loo should warn that some pareto-k are "too high"
291293
expect_warning(

0 commit comments

Comments
 (0)