From f904ff8c92310e06ece0a449679f35457a878127 Mon Sep 17 00:00:00 2001 From: Jim Hester Date: Tue, 11 Oct 2022 11:39:33 -0400 Subject: [PATCH] Ensure we don't leave behind cache files after running tests --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ tests/testthat/test-cache.R | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 40fe1adb6..be9c45d4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: lintr Title: A 'Linter' for R Code -Version: 3.0.1 +Version: 3.0.2 Authors@R: c( person("Jim", "Hester", , "james.f.hester@gmail.com", role = c("aut", "cre")), person("Florent", "Angly", role = "aut", diff --git a/NEWS.md b/NEWS.md index f1ebf8f4b..82ce8ebf5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# lintr 3.0.2 + +* Fix test to avoid leaving behind cache files in the global cache directory. + # lintr 3.0.1 * Skip multi-byte tests in non UTF-8 locales (#1504) diff --git a/tests/testthat/test-cache.R b/tests/testthat/test-cache.R index b2812378a..73ebb4597 100644 --- a/tests/testthat/test-cache.R +++ b/tests/testthat/test-cache.R @@ -19,6 +19,10 @@ fixtures$retrieve_lint <- function() { ) } +# Run tests with a temporary cache directory, so we don't leave files behind +# after running +withr::local_options(lintr.cache_directory = withr::local_tempdir()) + # Helper functions fhash <- function(filename) {