From 300cf8838cbda008159601302bb4c2c844f12a80 Mon Sep 17 00:00:00 2001 From: olivroy Date: Tue, 3 Oct 2023 11:37:44 -0400 Subject: [PATCH] tz warning only present on R 4.3 and R devel. --- tests/testthat/helper.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index 7cd5ca79..4807cc1c 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -1,6 +1,11 @@ expect_tz_warning <- function(object) { # FIXME when the tzone warning is fixed, delete this function, # use Replace all expect_tz_warning -> expect_no_warning + # This is for R >= 4.3.0 # Issue #156 - expect_warning(object, regexp = "tzone") + if (getRversion() >= "4.3.0") { + expect_warning(object, regexp = "tzone") + } else { + expect_no_warning(object) + } }