Skip to content

Commit c0cf4c1

Browse files
authored
Merge pull request #64 from MichaelChirico/patch-1
Optionally skip tests requiring 'yaml'
2 parents 85d0df2 + 3f71ff1 commit c0cf4c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/testthat/test_logger_config.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ test_that("logger_config() works as expected", {
2727

2828

2929
test_that("as_logger_config() works as expected with YAML and JSON files", {
30+
skip_if_not_installed("yaml")
3031
# files work...
3132
cy <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_full.yaml"))
3233
cj <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_full.json"))
@@ -49,6 +50,7 @@ test_that("as_logger_config() works as expected with YAML and JSON files", {
4950

5051

5152
test_that("as_logger_config() works for simplified yaml logger config", {
53+
skip_if_not_installed("yaml")
5254
cy <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_simple.yaml"))
5355
cj <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_simple.json"))
5456
expect_identical(cj, cy)
@@ -115,6 +117,7 @@ test_that("resolve_r6_ctors() works as expected", {
115117

116118

117119
test_that("parse_logger_config() works", {
120+
skip_if_not_installed("yaml")
118121
# parse_logger_config turns logger_configs into lists of R6 objects
119122
# that cann direclty be applied to a logger
120123
full <- as_logger_config(rprojroot::find_testthat_root_file("testdata", "lg_full.yaml"))

0 commit comments

Comments
 (0)