From 09ae3347fb84c108f79737e312910876ed009b12 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 26 Sep 2023 09:25:50 -0400 Subject: [PATCH] Silence warnings, tests --- NEWS.md | 4 ++++ R/georeference_overlay.R | 2 +- tests/testthat/test-4-merge_rasters.R | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 0f7a40e..0fd7ea0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # terrainr (development version) +* More tests are flagged to skip on CRAN, or when run offline + +* `georeference_overlay` should give fewer useless warnings + # terrainr 0.7.4 * New query method is dramatically faster and less-error prone. diff --git a/R/georeference_overlay.R b/R/georeference_overlay.R index e749e89..185f8e1 100644 --- a/R/georeference_overlay.R +++ b/R/georeference_overlay.R @@ -63,7 +63,7 @@ georeference_overlay <- function(overlay_file, image_read <- switch(file_type, "png" = png::readPNG, - "tiff" = tiff::readTIFF, + "tiff" = \(x) suppressWarnings(tiff::readTIFF(x)), "jpeg" = jpeg::readJPEG ) diff --git a/tests/testthat/test-4-merge_rasters.R b/tests/testthat/test-4-merge_rasters.R index 428fd05..6111ff1 100644 --- a/tests/testthat/test-4-merge_rasters.R +++ b/tests/testthat/test-4-merge_rasters.R @@ -44,6 +44,7 @@ test_that("merge_raster files are identical no matter the filename", { test_that("fallback method works", { skip_on_cran() + skip_if_offline() # Just for time savings skip_on_os(c("windows", "mac")) df <- data.frame( @@ -90,6 +91,7 @@ test_that("fallback method works", { test_that("overwrite works as expected", { skip_on_cran() + skip_if_offline() test_file <- tempfile(fileext = ".tif") test_copy <- tempfile(fileext = ".tif")