From 0dad06939475873d868f578ed5b6828f0d8007e4 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Wed, 26 Jul 2023 09:45:49 -0700 Subject: [PATCH] remove duplicate repopath helper (#1600) --- tests/testthat/helper-setup.R | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/testthat/helper-setup.R b/tests/testthat/helper-setup.R index c8bfe43fb..119d2b467 100644 --- a/tests/testthat/helper-setup.R +++ b/tests/testthat/helper-setup.R @@ -129,10 +129,6 @@ renv_tests_setup_packages <- function() { } -renv_tests_repopath <- function() { - getOption("renv.tests.repopath") -} - renv_tests_setup_libpaths <- function(scope = parent.frame()) { # remove the sandbox from the library paths, just in case we tried @@ -146,15 +142,11 @@ renv_tests_setup_libpaths <- function(scope = parent.frame()) { renv_tests_setup_repos <- function(scope = parent.frame()) { # generate our dummy repository - repopath <- getOption("renv.tests.repopath") - if (!is.null(repopath)) { + repopath <- renv_tests_repopath() + if (file.exists(repopath)) return() - } - - repopath <- renv_scope_tempfile("renv-repos-", scope = scope) - renv_scope_options(renv.tests.repopath = repopath, scope = scope) - repopath <- renv_tests_repopath() + # create repository source directory contrib <- file.path(repopath, "src/contrib") ensure_directory(contrib)