Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally skip tests requiring 'MASS' #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/testthat/test0_simple_mm.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ test_that("optional arguments work",

test_that("factor handling works",
{
skip_if_not_installed("MASS")
data(Insurance, package="MASS")
# don't worry about ordered factors for now
class(Insurance$Group) <- "factor"
Expand Down Expand Up @@ -97,6 +98,7 @@ test_that("nonsyntactic vars work",

test_that("interaction/expression terms work",
{
skip_if_not_installed("MASS")
data(Insurance, package="MASS")
xy1 <- simple_mf(Claims / Holders ~ District * Group + Age, data=Insurance)
expect_is(xy1$x, "matrix")
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test1_glmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test_that("glmnet arguments work", {
expect_equivalent(mod00$beta, mod0$beta)
expect_equivalent(mod0$beta, mod1$beta)

skip_if_not_installed("MASS")
data(Insurance, package="MASS")
# don't worry about ordered factors for now
class(Insurance$Group) <- "factor"
Expand Down Expand Up @@ -82,6 +83,7 @@ test_that("predict and coef work", {


test_that("prediction with NA works", {
skip_if_not_installed("MASS")
data(Boston, package="MASS")
BostonNA <- Boston
BostonNA[1, ] <- NA
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test2_cv_glmnet.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
context("cv.glmnet")

skip_if_not_installed("MASS")
data(Boston, package="MASS")
x <- as.matrix(Boston[-1])
y <- Boston$crim
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test6_relaxed_cv.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("relaxed cv.glmnet")


skip_if_not_installed("MASS")
data(Boston, package="MASS")
x <- as.matrix(Boston[-1])
y <- Boston$crim
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test7_family.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test_that("enhanced family arg works with glmnet", {


test_that("enhanced family arg works with cv.glmnet", {
skip_if_not_installed("MASS")
data(Boston, package="MASS")
x <- as.matrix(Boston[-1])
y <- Boston$crim
Expand Down Expand Up @@ -57,6 +58,7 @@ test_that("enhanced family arg works with cv.glmnet", {


test_that("enhanced family arg works with cva.glmnet", {
skip_if_not_installed("MASS")
data(Boston, package="MASS")

set.seed(12345)
Expand Down Expand Up @@ -94,6 +96,7 @@ test_that("enhanced family arg works with relaxed glmnet", {


test_that("enhanced family arg works with relaxed cv.glmnet", {
skip_if_not_installed("MASS")
data(Boston, package="MASS")
x <- as.matrix(Boston[-1])
y <- Boston$crim
Expand Down