From f7f3a11869d4067283ceae1e973c83f75ba53721 Mon Sep 17 00:00:00 2001 From: David Hugh-Jones Date: Mon, 10 Jun 2024 17:23:16 +0100 Subject: [PATCH] Tweak test --- tests/testthat/test-chop.R | 2 -- tests/testthat/test-nonstandard.R | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/testthat/test-chop.R b/tests/testthat/test-chop.R index 42eaa9f..20188b8 100644 --- a/tests/testthat/test-chop.R +++ b/tests/testthat/test-chop.R @@ -17,8 +17,6 @@ test_that("basic functionality", { chop(x, rc_brks, lbl_seq("1"), extend = FALSE), factor(c(1, 2, 2)) ) - - }) diff --git a/tests/testthat/test-nonstandard.R b/tests/testthat/test-nonstandard.R index 4426c39..d00d11b 100644 --- a/tests/testthat/test-nonstandard.R +++ b/tests/testthat/test-nonstandard.R @@ -7,11 +7,10 @@ test_that("character", { chop(x, br) ) - oo <- options(santoku.warn_character = FALSE) - on.exit(options(oo)) - - expect_silent( - chop(x, br) + withr::with_options(list(santoku.warn_character = FALSE), + expect_silent( + chop(x, br) + ) ) # here, we think there should *always* be a warning