From 1a604aef7815f4c9d9b2dd35fc77c8926ca3377a Mon Sep 17 00:00:00 2001 From: Julia Gustavsen Date: Sun, 16 Jul 2023 08:00:48 +0200 Subject: [PATCH] fixed skip on cran usage in new tests. --- tests/testthat/test-allgensnp.R | 2 -- tests/testthat/test-users.R | 14 ++++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/testthat/test-allgensnp.R b/tests/testthat/test-allgensnp.R index 422e8fb..e3f3e33 100644 --- a/tests/testthat/test-allgensnp.R +++ b/tests/testthat/test-allgensnp.R @@ -5,8 +5,6 @@ test_that("allgensnps returns the proper dataframe", { ## for testing it is useful to be able to only get a subset of users - skip_on_cran() - vcr::use_cassette("allgensnp_error", { expect_error(dat <- allgensnp(snp = "rs486907", usersubset = "1-8")) diff --git a/tests/testthat/test-users.R b/tests/testthat/test-users.R index 4f5d0d8..0a91130 100644 --- a/tests/testthat/test-users.R +++ b/tests/testthat/test-users.R @@ -1,4 +1,5 @@ test_that("getting users from opensnp works", { + skip_on_cran() vcr::use_cassette("users", { data <- users(df = TRUE) }) @@ -6,10 +7,11 @@ test_that("getting users from opensnp works", { expect_equal(nrow(data[[1]]), 5476) }) - -vcr::use_cassette("users_badgateway", { - test_that("fail with 502, bad gateway, when getting opensnp users", { - expect_error(users(df = TRUE)) +test_that("getting users with bad gateway errors out", { + skip_on_cran() + vcr::use_cassette("users_badgateway", { + test_that("fail with 502, bad gateway, when getting opensnp users", { + expect_error(users(df = TRUE)) + }) }) - -}) +}) \ No newline at end of file