From ab0dd3a017ffa0b4fc6a017f848d6ff8863f01e7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 18 Sep 2023 20:56:18 +0200 Subject: [PATCH] Tests failing in random order (again) (#758) * Tests failing in random order (again) Fixes #757 * fix * fix * fix styling --------- Co-authored-by: Indrajeet Patil --- tests/testthat/test-get_modelmatrix.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-get_modelmatrix.R b/tests/testthat/test-get_modelmatrix.R index fc7b7ef8e..6b45f6392 100644 --- a/tests/testthat/test-get_modelmatrix.R +++ b/tests/testthat/test-get_modelmatrix.R @@ -60,12 +60,13 @@ test_that("get_modelmatrix - ivreg", { skip_if(getRversion() < "4.2.0") skip_if_not_installed("ivreg") data(Kmenta, package = "ivreg") + d_kmenta <<- Kmenta set.seed(15) - x <- ivreg::ivreg(Q ~ P + D | D + F + A, data = Kmenta) + x <- ivreg::ivreg(Q ~ P + D | D + F + A, data = d_kmenta) out1 <- get_modelmatrix(x) - out2 <- model.matrix(x, data = Kmenta) + out2 <- model.matrix(x, data = d_kmenta) expect_equal(out1, out2, tolerance = 1e-3, ignore_attr = TRUE) out1 <- get_modelmatrix(x, data = get_datagrid(x, at = "P"))