Skip to content

Commit

Permalink
tests: load helper functions only locally
Browse files Browse the repository at this point in the history
  • Loading branch information
nkehrein committed Oct 23, 2024
1 parent c86766d commit dd80dca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-calibrate.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ test_that("fit to calibration set", {
})

test_that("failed simulations during fitting", {
source(test_path("class-DummyScenario.R"))
source(test_path("class-DummyScenario.R"), local=TRUE)

fail <- DummyFails()
fail@param$foo <- 1
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-epx.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test_that("factor cutoff", {
})

test_that("ep_only", {
source(test_path("class-DummyScenario.R"))
source(test_path("class-DummyScenario.R"), local=TRUE)

sc <- DummyScenario()

Expand All @@ -62,7 +62,7 @@ test_that("ep_only", {
})

test_that("long_format", {
source(test_path("class-DummyScenario.R"))
source(test_path("class-DummyScenario.R"), local=TRUE)

sc <- DummyScenario() %>% set_exposure(data.frame(t=0, c=1))

Expand All @@ -84,7 +84,7 @@ test_that("long_format", {
})

test_that("error handling", {
source(test_path("class-DummyScenario.R"))
source(test_path("class-DummyScenario.R"), local=TRUE)

# only a single scenario and it failed
expect_warning(rs <- epx(DummyFails(), level=10))
Expand Down

0 comments on commit dd80dca

Please sign in to comment.