Skip to content

Commit 2ee21c2

Browse files
committed
no more expect_error()
1 parent d0bfb7c commit 2ee21c2

File tree

9 files changed

+22
-33
lines changed

9 files changed

+22
-33
lines changed

tests/testthat/test-dummy_hash.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
231231
rec <- prep(rec)
232232
)
233233

234-
expect_error(
235-
bake(rec, new_data = test_data),
236-
NA
234+
expect_no_error(
235+
bake(rec, new_data = test_data)
237236
)
238237
})
239238

tests/testthat/test-lda.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
175175
rec <- prep(rec)
176176
)
177177

178-
expect_error(
179-
bake(rec, new_data = tate_text[seq_len(n_rows), ]),
180-
NA
178+
expect_no_error(
179+
bake(rec, new_data = tate_text[seq_len(n_rows), ])
181180
)
182181
})
183182

tests/testthat/test-sequence_onehot.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
237237
rec <- prep(rec)
238238
)
239239

240-
expect_error(
241-
bake(rec, new_data = test_data),
242-
NA
240+
expect_no_error(
241+
bake(rec, new_data = test_data)
243242
)
244243
})
245244

tests/testthat/test-textfeature.R

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
178178
rec <- prep(rec)
179179
)
180180

181-
expect_error(
182-
bake(rec, new_data = test_data),
183-
NA
181+
expect_no_error(
182+
bake(rec, new_data = test_data)
184183
)
185184
})
186185
test_that("keep_original_cols works", {
@@ -219,9 +218,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
219218
rec <- prep(rec)
220219
)
221220

222-
expect_error(
223-
bake(rec, new_data = test_data),
224-
NA
221+
expect_no_error(
222+
bake(rec, new_data = test_data)
225223
)
226224
})
227225

tests/testthat/test-texthash.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
215215
rec <- prep(rec)
216216
)
217217

218-
expect_error(
219-
bake(rec, new_data = test_data),
220-
NA
218+
expect_no_error(
219+
bake(rec, new_data = test_data)
221220
)
222221
})
223222

tests/testthat/test-tf.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
246246
rec <- prep(rec)
247247
)
248248

249-
expect_error(
250-
bake(rec, new_data = test_data),
251-
NA
249+
expect_no_error(
250+
bake(rec, new_data = test_data)
252251
)
253252
})
254253

tests/testthat/test-tfidf.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
235235
rec <- prep(rec)
236236
)
237237

238-
expect_error(
239-
bake(rec, new_data = test_data),
240-
NA
238+
expect_no_error(
239+
bake(rec, new_data = test_data)
241240
)
242241
})
243242

tests/testthat/test-tokenmerge.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
165165
rec <- prep(rec)
166166
)
167167

168-
expect_error(
169-
bake(rec, new_data = test_data),
170-
NA
168+
expect_no_error(
169+
bake(rec, new_data = test_data)
171170
)
172171
})
173172

tests/testthat/test-word_embeddings.R

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ test_that("step_word_embeddings deals with missing words appropriately.", {
137137
new_text <- tibble(
138138
text = "aksjdf nagjli aslkfa"
139139
)
140-
expect_error(
141-
bake(obj, new_data = new_text),
142-
NA
140+
expect_no_error(
141+
bake(obj, new_data = new_text)
143142
)
144143
})
145144

@@ -377,9 +376,8 @@ test_that("keep_original_cols - can prep recipes with it missing", {
377376
rec <- prep(rec)
378377
)
379378

380-
expect_error(
381-
bake(rec, new_data = test_data),
382-
NA
379+
expect_no_error(
380+
bake(rec, new_data = test_data)
383381
)
384382
})
385383

0 commit comments

Comments
 (0)