Running ‘testthat.R’ [11s/12s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > test_check('autovarCore')
  Loading required package: autovarCore
  ── 1. Error: autovar function returns hello world (@test_autovar.r#14)  ────────
  Can't mock functions in base packages (parallel)
  1: with_mock(`parallel::clusterMap` = function(cluster, ...) {
         mapply(...)
     }, `parallel::makeCluster` = function(...) {
         NULL
     }, `parallel::stopCluster` = function(...) {
         NULL
     }, expect_equal(class(autovar(testdata_raw_dataframe(), selected_column_names = c("rumination", 
         "happiness", "activity"), imputation_iterations = 1)), "list")) at testthat/test_autovar.r:14
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 2. Error: model_score calls its subfunctions correctly for AIC (@test_model_s
  Can't mock functions in base packages (base)
  1: with_mock(`base::summary` = function(...) {
         called_count_summary <<- called_count_summary + 1
         expect_equal(list(...), list(1))
         list(obs = 2)
     }, `autovarCore:::nr_estimated_parameters` = function(...) {
         called_count_nr_est <<- called_count_nr_est + 1
         expect_equal(list(...), list(1))
         3
     }, `autovarCore:::determine_loglikelihood` = function(...) {
         called_count_determine <<- called_count_determine + 1
         expect_equal(list(...), list(1, FALSE))
         4
     }, expect_equal(autovarCore:::model_score(1, "AIC", FALSE), -2 * 4 + 2 * 3)) at testthat/test_model_score.r:50
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 3. Error: model_score calls its subfunctions correctly for BIC (@test_model_s
  Can't mock functions in base packages (base)
  1: with_mock(`base::summary` = function(...) {
         called_count_summary <<- called_count_summary + 1
         expect_equal(list(...), list(1))
         list(obs = 2)
     }, `autovarCore:::nr_estimated_parameters` = function(...) {
         called_count_nr_est <<- called_count_nr_est + 1
         expect_equal(list(...), list(1))
         3
     }, `autovarCore:::determine_loglikelihood` = function(...) {
         called_count_determine <<- called_count_determine + 1
         expect_equal(list(...), list(1, FALSE))
         4
     }, expect_less_than(abs(autovarCore:::model_score(1, "BIC", FALSE) - (-2 * 4 + log(2) * 
         3)), 1e-06)) at testthat/test_model_score.r:81
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 4. Error: select_valid_masks calls bitwAnd correctly (@test_select_valid_mask
  Can't mock functions in base packages (base)
  1: with_mock(`base::bitwAnd` = function(...) {
         called_count <<- called_count + 1
         expect_equal(list(...), list(input_masks[called_count], 1))
         0
     }, expect_equal(autovarCore:::select_valid_masks(input_masks, 1), input_masks)) at testthat/test_select_valid_masks.r:15
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 448 SKIPPED: 0 FAILED: 4
  1. Error: autovar function returns hello world (@test_autovar.r#14) 
  2. Error: model_score calls its subfunctions correctly for AIC (@test_model_score.r#50) 
  3. Error: model_score calls its subfunctions correctly for BIC (@test_model_score.r#81) 
  4. Error: select_valid_masks calls bitwAnd correctly (@test_select_valid_masks.r#15) 
  
  Error: testthat unit tests failed
  Execution halted