Skip to content

Commit d645c0a

Browse files
committed
test_path()
1 parent 6b8ad19 commit d645c0a

20 files changed

+35
-23
lines changed

tests/testthat/test_boost_tree_C50.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ library(dplyr)
66
# ------------------------------------------------------------------------------
77

88
context("boosted tree execution with C5.0")
9-
source("helper-objects.R")
9+
source(test_path("helper-objects.R"))
1010

1111
lending_club <- head(lending_club, 200)
1212
lending_club_fail <-

tests/testthat/test_boost_tree_spark.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("boosted tree execution with spark")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
99

1010
# ------------------------------------------------------------------------------
1111

tests/testthat/test_boost_tree_xgboost.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ library(parsnip)
44
# ------------------------------------------------------------------------------
55

66
context("boosted tree execution with xgboost")
7-
source("helper-objects.R")
7+
source(test_path("helper-objects.R"))
8+
89

910
num_pred <- names(iris)[1:4]
1011

tests/testthat/test_linear_reg.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ library(tibble)
66
# ------------------------------------------------------------------------------
77

88
context("linear regression")
9-
source("helpers.R")
10-
source("helper-objects.R")
9+
source(test_path("helpers.R"))
10+
source(test_path("helper-objects.R"))
11+
1112

1213
# ------------------------------------------------------------------------------
1314

tests/testthat/test_linear_reg_glmnet.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ library(tidyr)
66
# ------------------------------------------------------------------------------
77

88
context("linear regression execution with glmnet")
9-
source("helper-objects.R")
9+
source(test_path("helper-objects.R"))
10+
1011

1112
num_pred <- c("Sepal.Width", "Petal.Width", "Petal.Length")
1213
iris_bad_form <- as.formula(Species ~ term)

tests/testthat/test_linear_reg_keras.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ library(tibble)
66
# ------------------------------------------------------------------------------
77

88
context("keras linear regression")
9-
source("helpers.R")
10-
source("helper-objects.R")
9+
source(test_path("helpers.R"))
10+
source(test_path("helper-objects.R"))
1111

1212
# ------------------------------------------------------------------------------
1313

tests/testthat/test_linear_reg_spark.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("linear regression execution with spark")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
9+
910

1011
# ------------------------------------------------------------------------------
1112

tests/testthat/test_logistic_reg.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ library(tibble)
66
# ------------------------------------------------------------------------------
77

88
context("logistic regression")
9-
source("helpers.R")
10-
source("helper-objects.R")
9+
source(test_path("helpers.R"))
10+
source(test_path("helper-objects.R"))
11+
1112

1213
# ------------------------------------------------------------------------------
1314

tests/testthat/test_logistic_reg_glmnet.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ library(tidyr)
77
# ------------------------------------------------------------------------------
88

99
context("logistic regression execution with glmnet")
10-
source("helper-objects.R")
10+
source(test_path("helper-objects.R"))
1111

1212
lending_club <- head(lending_club, 200)
1313
lc_form <- as.formula(Class ~ log(funded_amnt) + int_rate)

tests/testthat/test_logistic_reg_spark.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("logistic regression execution with spark")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
99

1010
# ------------------------------------------------------------------------------
1111

tests/testthat/test_mlp_keras.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ library(tibble)
55
# ------------------------------------------------------------------------------
66

77
context("simple neural network execution with keras")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
9+
910

1011
num_pred <- names(iris)[1:4]
1112

tests/testthat/test_mlp_nnet.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ library(parsnip)
44
# ------------------------------------------------------------------------------
55

66
context("simple neural network execution with nnet")
7-
source("helper-objects.R")
7+
source(test_path("helper-objects.R"))
88

99
num_pred <- names(iris)[1:4]
1010

tests/testthat/test_multinom_reg_glmnet.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ library(tibble)
66
# ------------------------------------------------------------------------------
77

88
context("multinom regression execution with glmnet")
9-
source("helper-objects.R")
9+
source(test_path("helper-objects.R"))
10+
1011

1112
rows <- c(1, 51, 101)
1213

tests/testthat/test_multinom_reg_spark.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("multinomial regression execution with spark")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
9+
910

1011
# ------------------------------------------------------------------------------
1112

tests/testthat/test_nearest_neighbor_kknn.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ library(rlang)
55
# ------------------------------------------------------------------------------
66

77
context("nearest neighbor execution with kknn")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
9+
910

1011
num_pred <- c("Sepal.Width", "Petal.Width", "Petal.Length")
1112
iris_bad_form <- as.formula(Species ~ term)

tests/testthat/test_rand_forest_randomForest.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library(tibble)
55
# ------------------------------------------------------------------------------
66

77
context("random forest execution with randomForest")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
99

1010
# ------------------------------------------------------------------------------
1111

tests/testthat/test_rand_forest_ranger.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ library(rlang)
66
# ------------------------------------------------------------------------------
77

88
context("random forest execution with ranger")
9-
source("helper-objects.R")
9+
source(test_path("helper-objects.R"))
10+
1011

1112
# ------------------------------------------------------------------------------
1213

tests/testthat/test_rand_forest_spark.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("random forest execution with spark")
8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
9+
910

1011
# ------------------------------------------------------------------------------
1112

tests/testthat/test_surv_reg_flexsurv.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ library(tibble)
66

77
# ------------------------------------------------------------------------------
88

9-
source("helper-objects.R")
9+
source(test_path("helper-objects.R"))
10+
1011

1112
basic_form <- Surv(time, status) ~ age
1213
complete_form <- Surv(time) ~ age

tests/testthat/test_surv_reg_survreg.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library(tibble)
55

66
# ------------------------------------------------------------------------------
77

8-
source("helper-objects.R")
8+
source(test_path("helper-objects.R"))
99

1010
basic_form <- Surv(time, status) ~ group
1111
complete_form <- Surv(time) ~ group

0 commit comments

Comments
 (0)