From d1d64fba2271950eee9b34745c412a39849580b9 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:31:35 +0000 Subject: [PATCH] clean up tests --- R/shared-methods.R | 10 ++++++---- tests/testthat/test-get_national_data.R | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/R/shared-methods.R b/R/shared-methods.R index 0433831e..8974d8ac 100644 --- a/R/shared-methods.R +++ b/R/shared-methods.R @@ -638,10 +638,12 @@ CountryDataClass <- R6::R6Class("CountryDataClass", } if (!is.null(self$target_regions)) { - self$target_regions <- countryname( - self$target_regions, - destination = "country.name.en", - warn = FALSE + self$target_regions <- suppressWarnings( + countryname( + self$target_regions, + destination = "country.name.en", + warn = FALSE + ) ) if (all(is.na(self$target_regions))) { stop("No countries found with target names") diff --git a/tests/testthat/test-get_national_data.R b/tests/testthat/test-get_national_data.R index 9133e4ce..de83e30e 100644 --- a/tests/testthat/test-get_national_data.R +++ b/tests/testthat/test-get_national_data.R @@ -26,10 +26,6 @@ test_get_national_data <- function(source) { countries = "rwfwf", source = source, verbose = FALSE )) - expect_warning(get_national_data( - countries = "Zimbabwe", source = source, - verbose = FALSE - )) expect_equal( true_steps, get_national_data(source = source, steps = TRUE, verbose = FALSE)