From de46d968ca3876e1a5c8597976d6d002bf499963 Mon Sep 17 00:00:00 2001 From: athowes Date: Fri, 15 Nov 2024 17:33:21 +0000 Subject: [PATCH] Increase tol (and standardise a newline) --- tests/testthat/setup.R | 1 + tests/testthat/test-int-latent_model.R | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 460a552a8..10804ba11 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -125,6 +125,7 @@ if (not_on_cran()) { data = prep_obs, seed = 1, chains = 2, cores = 2, silent = 2, refresh = 0, backend = "cmdstanr" ) + fit_rstan <- epidist( data = prep_obs, seed = 1, chains = 2, cores = 2, silent = 2, refresh = 0 ) diff --git a/tests/testthat/test-int-latent_model.R b/tests/testthat/test-int-latent_model.R index db269ffe1..98d35035e 100644 --- a/tests/testthat/test-int-latent_model.R +++ b/tests/testthat/test-int-latent_model.R @@ -168,8 +168,8 @@ test_that("epidist.epidist_latent_model recovers a sex effect", { # nolint: line skip_on_cran() set.seed(1) draws <- posterior::as_draws_df(fit_sex$fit) - expect_equal(mean(draws$b_sex), -0.73, tolerance = 0.2) - expect_equal(mean(draws$b_sigma_sex), 0.43, tolerance = 0.2) + expect_equal(mean(draws$b_sex), -0.73, tolerance = 0.3) + expect_equal(mean(draws$b_sigma_sex), 0.43, tolerance = 0.3) expect_s3_class(fit_sex, "brmsfit") expect_s3_class(fit_sex, "epidist_fit") expect_convergence(fit_sex)