Skip to content

Commit

Permalink
Merge pull request #236 from tidymodels/no-source-in-tests
Browse files Browse the repository at this point in the history
No source in tests
  • Loading branch information
EmilHvitfeldt authored Nov 8, 2024
2 parents 9c10054 + a249560 commit babb179
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 29 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions tests/testthat/test-discretize_cart.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ library(testthat)
library(dplyr)
library(rpart)

source(test_path("make_binned_data.R"))

set.seed(8497)
sim_tr_cls <- sim_data_2class(1000)
sim_te_cls <- sim_data_2class(100)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-discretize_xgb.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ skip_on_cran()
skip_if_not_installed("xgboost")
skip_if_not_installed("modeldata")

source(test_path("make_binned_data.R"))

data("credit_data", package = "modeldata")
data("ames", package = "modeldata")
data("attrition", package = "modeldata")
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-embed.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
source(testthat::test_path("make_example_data.R"))
source(testthat::test_path("test-helpers.R"))

# Stops noisy tensorflow messages
withr::local_envvar(TF_CPP_MIN_LOG_LEVEL = "2")

Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-feature_hash.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
source(testthat::test_path("make_example_data.R"))
source(testthat::test_path("test-helpers.R"))

test_that("basic usage", {
skip_on_cran()
skip_if_not_installed("keras")
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-lencode_bayes.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
source(testthat::test_path("make_example_data.R"))
source(testthat::test_path("test-helpers.R"))

opts <- list(seed = 34677, chains = 2, iter = 500)

omit_warning <- function(pattern) {
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-lencode_glm.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
source(testthat::test_path("make_example_data.R"))
source(testthat::test_path("test-helpers.R"))

test_that("factor encoded predictor", {
class_test <- recipe(x2 ~ ., data = ex_dat) %>%
step_lencode_glm(x3, outcome = vars(x2), id = "id") %>%
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-lencode_mixed.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
source(testthat::test_path("make_example_data.R"))
source(testthat::test_path("test-helpers.R"))

test_that("factor encoded predictor", {
skip_if_not_installed("Matrix", "1.6-2")
skip_if_not_installed("lme4", "1.1-35.1")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-pca_sparse.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source(testthat::test_path("test-helpers.R"))

test_that("step_pca_sparse", {
skip_if_not_installed("irlba")
skip_if_not_installed("modeldata")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-pca_sparse_bayes.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source(testthat::test_path("test-helpers.R"))

test_that("step_pca_sparse_bayes", {
skip_if_not_installed("VBsparsePCA")
skip_if_not_installed("modeldata")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-pca_truncated.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source(testthat::test_path("test-helpers.R"))

test_that("step_pca_truncated", {
skip_if_not_installed("irlba")
skip_if_not_installed("modeldata")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-umap.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source(testthat::test_path("test-helpers.R"))

iris_dat <- iris

iris_dat[, 1:4] <- scale(iris_dat[, 1:4])
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-woe.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source(testthat::test_path("test-helpers.R"))

set.seed(1)
df <- data.frame(
x1 = sample(c("A", "B", "C"), size = 20, replace = TRUE) %>% factor(),
Expand Down

0 comments on commit babb179

Please sign in to comment.