From 96c3f9a56d23b0716220366a84573840e97de2a9 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Fri, 2 Jun 2023 09:41:57 +0200 Subject: [PATCH] Use testthat edition 3; remove context() --- DESCRIPTION | 1 + tests/testthat/test-AbsToProbs.R | 2 -- tests/testthat/test-AccumulationExceedingThreshold.R | 3 +-- tests/testthat/test-MergeRefToExp.R | 2 -- tests/testthat/test-PeriodAccumulation.R | 3 +-- tests/testthat/test-PeriodMean.R | 3 +-- tests/testthat/test-QThreshold.R | 3 +-- tests/testthat/test-SelectPeriod.R | 2 +- tests/testthat/test-Threshold.R | 3 +-- tests/testthat/test-TotalSpellTimeExceedingThreshold.R | 2 +- tests/testthat/test-TotalTimeExceedingThreshold.R | 2 +- tests/testthat/test-WindCapacityFactor.R | 2 +- tests/testthat/test-WindPowerDensity.R | 2 +- 13 files changed, 11 insertions(+), 19 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 90e0e83..4151ba4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,3 +40,4 @@ URL: https://earth.bsc.es/gitlab/es/csindicators/ BugReports: https://earth.bsc.es/gitlab/es/csindicators/-/issues Encoding: UTF-8 RoxygenNote: 7.2.0 +Config/testthat/edition: 3 \ No newline at end of file diff --git a/tests/testthat/test-AbsToProbs.R b/tests/testthat/test-AbsToProbs.R index 902b3f1..c2cdc9f 100644 --- a/tests/testthat/test-AbsToProbs.R +++ b/tests/testthat/test-AbsToProbs.R @@ -1,5 +1,3 @@ -context("CSIndicators::AbsToProbs tests") - ############################################## # dat1 dat1 <- NULL diff --git a/tests/testthat/test-AccumulationExceedingThreshold.R b/tests/testthat/test-AccumulationExceedingThreshold.R index a6b598e..0331e8e 100644 --- a/tests/testthat/test-AccumulationExceedingThreshold.R +++ b/tests/testthat/test-AccumulationExceedingThreshold.R @@ -1,5 +1,4 @@ -context("CSIndicators::AccumulationExceedingThreshold tests") - +############################################## # dat1 dat1 <- 1:20 diff --git a/tests/testthat/test-MergeRefToExp.R b/tests/testthat/test-MergeRefToExp.R index 2c3e8f6..adbdfd6 100644 --- a/tests/testthat/test-MergeRefToExp.R +++ b/tests/testthat/test-MergeRefToExp.R @@ -1,5 +1,3 @@ -context("CSIndicators::MergeRefToExp tests") - ########################################################################### test_that("Sanity checks", { diff --git a/tests/testthat/test-PeriodAccumulation.R b/tests/testthat/test-PeriodAccumulation.R index 777dc30..81718f5 100644 --- a/tests/testthat/test-PeriodAccumulation.R +++ b/tests/testthat/test-PeriodAccumulation.R @@ -1,5 +1,4 @@ -context("CSIndicators::PeriodAccumulation tests") - +############################################## test_that("Sanity Checks", { expect_error( PeriodAccumulation('x'), diff --git a/tests/testthat/test-PeriodMean.R b/tests/testthat/test-PeriodMean.R index 7576b11..4186639 100644 --- a/tests/testthat/test-PeriodMean.R +++ b/tests/testthat/test-PeriodMean.R @@ -1,5 +1,4 @@ -context("CSIndicators::PeriodMean tests") - +############################################## test_that("Sanity Checks", { expect_error( PeriodMean('x'), diff --git a/tests/testthat/test-QThreshold.R b/tests/testthat/test-QThreshold.R index 41cc3e5..deb35df 100644 --- a/tests/testthat/test-QThreshold.R +++ b/tests/testthat/test-QThreshold.R @@ -1,5 +1,4 @@ -context("CSIndicators::QThreshold tests") - +############################################## test_that("Sanity checks", { expect_error( QThreshold(NULL), diff --git a/tests/testthat/test-SelectPeriod.R b/tests/testthat/test-SelectPeriod.R index 1c264c2..deb8656 100644 --- a/tests/testthat/test-SelectPeriod.R +++ b/tests/testthat/test-SelectPeriod.R @@ -1,4 +1,4 @@ -context("CSIndicators::SelectPeriodOnData and SelectPeriodOnDates tests") +############################################## library(s2dv) diff --git a/tests/testthat/test-Threshold.R b/tests/testthat/test-Threshold.R index 24ca601..84e4e0d 100644 --- a/tests/testthat/test-Threshold.R +++ b/tests/testthat/test-Threshold.R @@ -1,5 +1,4 @@ -context("CSIndicators::Threshold tests") - +############################################## test_that("Sanity checks", { expect_error( Threshold(NULL), diff --git a/tests/testthat/test-TotalSpellTimeExceedingThreshold.R b/tests/testthat/test-TotalSpellTimeExceedingThreshold.R index d215529..36e46cf 100644 --- a/tests/testthat/test-TotalSpellTimeExceedingThreshold.R +++ b/tests/testthat/test-TotalSpellTimeExceedingThreshold.R @@ -1,4 +1,4 @@ -context("CSIndicators::TotalSpellTimeExceedingThreshold tests") +############################################## # dat1 dat <- array(1:20, dim = c(2, 10)) diff --git a/tests/testthat/test-TotalTimeExceedingThreshold.R b/tests/testthat/test-TotalTimeExceedingThreshold.R index 68c6d77..1c3ca19 100644 --- a/tests/testthat/test-TotalTimeExceedingThreshold.R +++ b/tests/testthat/test-TotalTimeExceedingThreshold.R @@ -1,4 +1,4 @@ -context("CSIndicators::TotalTimeExceedingThreshold tests") +############################################## # dat1 dat <- array(1:20, dim = c(2, 10)) diff --git a/tests/testthat/test-WindCapacityFactor.R b/tests/testthat/test-WindCapacityFactor.R index 1bf9089..bcecdbc 100644 --- a/tests/testthat/test-WindCapacityFactor.R +++ b/tests/testthat/test-WindCapacityFactor.R @@ -1,4 +1,4 @@ -context("CSIndicators::WindCapacityFactor tests") +############################################## # dat1 wind <- NULL diff --git a/tests/testthat/test-WindPowerDensity.R b/tests/testthat/test-WindPowerDensity.R index 249c529..184b062 100644 --- a/tests/testthat/test-WindPowerDensity.R +++ b/tests/testthat/test-WindPowerDensity.R @@ -1,4 +1,4 @@ -context("CSIndicators::WindPowerDensity tests") +########################################################################### # dat1 wind <- NULL -- GitLab