Skip to content

Commit

Permalink
Optionally skip tests requiring Suggests package
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Aug 23, 2023
1 parent ac4f5a9 commit 181123b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/testthat/test-lmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test_that("lmap_at() only affects selected elements", {
})

test_that("lmap_at can use tidyselect", {
skip_if_not_installed("tidyselect")
local_options(lifecycle_verbosity = "quiet")

x <- lmap_at(mtcars, vars(tidyselect::contains("vs")), ~ .x + 10)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-modify.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ test_that("`.else` modifies false elements", {
})

test_that("modify_at() can use tidyselect", {
skip_if_not_installed("tidyselect")
local_options(lifecycle_verbosity = "quiet")

df <- data.frame(x = 1, y = 3)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test_that("validates its inputs", {
})

test_that("tidyselect `at` is deprecated", {
skip_if_not_installed("tidyselect")
expect_snapshot({
. <- where_at(data.frame(x = 1), vars("x"), user_env = globalenv())
})
Expand Down Expand Up @@ -98,6 +99,7 @@ test_that("can work with output of by", {
})

test_that("can work with lubridate periods", {
skip_if_not_installed("lubridate")
days <- lubridate::days(1:2)

expect_equal(map(days, identity), list(lubridate::days(1), lubridate::days(2)))
Expand Down

0 comments on commit 181123b

Please sign in to comment.