Skip to content

Commit f3b5443

Browse files
committed
add missing skip_if_not_installed
1 parent 11d4ece commit f3b5443

10 files changed

+26
-1
lines changed

Diff for: tests/testthat/test-dummy_hash.R

+4
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ test_that("tunable", {
158158
})
159159

160160
test_that("bad args", {
161+
skip_if_not_installed("modeldata")
162+
skip_if_not_installed("text2vec")
163+
data.table::setDTthreads(2) # because data.table uses all cores by default
164+
161165
expect_snapshot(
162166
error = TRUE,
163167
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-lda.R

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ test_that("check_name() is used", {
6565
})
6666

6767
test_that("bad args", {
68+
skip_if_not_installed("text2vec")
69+
skip_if_not_installed("data.table")
70+
skip_if_not_installed("modeldata")
71+
data.table::setDTthreads(2) # because data.table uses all cores by default
72+
6873
expect_snapshot(
6974
error = TRUE,
7075
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-pos_filter.R

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ test_that("lemmatization errors if lemma attribute doesn't exists", {
9595
})
9696

9797
test_that("bad args", {
98+
skip_on_cran()
99+
skip_if_not_installed("spacyr")
100+
skip_if_no_python_or_no_spacy()
101+
98102
expect_snapshot(
99103
error = TRUE,
100104
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-stopwords.R

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ test_that("custom stopwords are supported", {
7474
})
7575

7676
test_that("bad args", {
77+
skip_if_not_installed("stopwords")
78+
7779
expect_snapshot(
7880
error = TRUE,
7981
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-text_normalization.R

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ test_that("simple sqrt trans", {
1414
})
1515

1616
test_that("bad args", {
17+
skip_if_not_installed("stringi")
18+
1719
expect_snapshot(
1820
error = TRUE,
1921
recipe(~., data = mtcars) %>%
@@ -26,6 +28,7 @@ test_that("bad args", {
2628

2729
test_that("bake method errors when needed non-standard role columns are missing", {
2830
skip_if_not_installed("stringi")
31+
2932
rec <- recipe(~text, data = ex_dat) %>%
3033
step_text_normalization(text) %>%
3134
update_role(text, new_role = "potato") %>%

Diff for: tests/testthat/test-texthash.R

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ test_that("tunable", {
106106
})
107107

108108
test_that("bad args", {
109+
skip_if_not_installed("text2vec")
110+
109111
expect_snapshot(
110112
error = TRUE,
111113
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-tokenfilter.R

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ test_that("bad args", {
174174
)
175175
})
176176

177-
178177
# Infrastructure ---------------------------------------------------------------
179178

180179
test_that("bake method errors when needed non-standard role columns are missing", {

Diff for: tests/testthat/test-tokenize_bpe.R

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ test_that("tunable", {
155155
})
156156

157157
test_that("bad args", {
158+
skip_if_not_installed("tokenizers.bpe")
159+
158160
expect_snapshot(
159161
error = TRUE,
160162
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-tokenize_sentencepiece.R

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ test_that("Errors if vocabulary size is set to low.", {
125125
})
126126

127127
test_that("bad args", {
128+
skip_if_not_installed("sentencepiece")
129+
128130
expect_snapshot(
129131
error = TRUE,
130132
recipe(~., data = mtcars) %>%

Diff for: tests/testthat/test-tokenize_wordpiece.R

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ test_that("step_tokenize_wordpiece works with tokenizers.wordpiece and multiple
6262
})
6363

6464
test_that("bad args", {
65+
skip_if_not_installed("wordpiece")
66+
6567
expect_snapshot(
6668
error = TRUE,
6769
recipe(~., data = mtcars) %>%

0 commit comments

Comments
 (0)