Skip to content

Commit 9ce3ed1

Browse files
authored
Better way to check for tensorflow (#53)
* New way to check for tensorflow * Revert "New way to check for tensorflow" This reverts commit 10475ad. * Let's just skip on CRAN * More skipping without tensorflow * Remove extra `prep()`
1 parent 6347111 commit 9ce3ed1

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

tests/testthat/test_bundle_embed.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
test_that("bundling + unbundling step_umap", {
2+
skip_on_cran()
23
skip_if_not_installed("embed")
34
skip_if_not_installed("butcher")
5+
skip_if(is.null(tensorflow::tf_version()))
46

57
library(embed)
68

7-
skip_if_not(is_tf_available())
8-
99
# define a function to prep a recipe ------------------------------------------
1010
prep_rec <- function() {
1111
set.seed(1)

tests/testthat/test_bundle_keras.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_that("bundling + unbundling keras fits", {
2+
skip_on_cran()
23
skip_if_not_installed("keras")
34
skip_if_not_installed("butcher")
45
skip_if(is.null(tensorflow::tf_version()))

tests/testthat/test_bundle_workflows.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,20 @@ test_that("bundling + unbundling tidymodels workflows (xgboost + step_log)", {
123123
})
124124

125125
test_that("bundling + unbundling tidymodels workflows (lm + step_umap)", {
126+
skip_on_cran()
126127
skip_if_not_installed("workflows")
127128
skip_if_not_installed("parsnip")
128129
skip_if_not_installed("recipes")
129130
skip_if_not_installed("embed")
130131
skip_if_not_installed("butcher")
132+
skip_if(is.null(tensorflow::tf_version()))
131133

132134
library(workflows)
133135
library(parsnip)
134136
library(recipes)
135137
library(embed)
136138
library(butcher)
137139

138-
skip_if_not(is_tf_available())
139-
140140
# define a function to fit a model -------------------------------------------
141141
fit_model <- function() {
142142
set.seed(1)

0 commit comments

Comments
 (0)