Skip to content

Commit

Permalink
remove set.seed and added nolint tags to calc_dist_params tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Sep 5, 2023
1 parent 5969ad6 commit 173ff29
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions tests/testthat/test-calc_dist_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ test_that("calc_dist_params works as expected converting for different dist", {
})

test_that("calc_dist_params works as expected extracting from percentiles", {
# set seed for stochastic optimisation
set.seed(1)

# messages for numerical optimisation suppressed
params <- suppressMessages(calc_dist_params(
prob_dist = "gamma",
Expand All @@ -33,9 +30,6 @@ test_that("calc_dist_params works as expected extracting from percentiles", {
expect_vector(params, ptype = numeric(), size = 2)
expect_named(params, expected = c("shape", "scale"))

# set seed for stochastic optimisation
set.seed(1)

# messages for numerical optimisation suppressed
params <- suppressMessages(calc_dist_params(
prob_dist = "lnorm",
Expand All @@ -49,9 +43,6 @@ test_that("calc_dist_params works as expected extracting from percentiles", {
})

test_that("calc_dist_params works as expected extracting from median & range", {
# set seed for stochastic optimisation
set.seed(1)

# messages for numerical optimisation suppressed
params <- suppressMessages(calc_dist_params(
prob_dist = "gamma",
Expand All @@ -69,7 +60,7 @@ test_that("calc_dist_params works as expected extracting from median & range", {

test_that("calc_dist_params fails as expected extracting without sample size", {
expect_message(
params <- calc_dist_params(
params <- calc_dist_params( # nolint
prob_dist = "gamma",
summary_stats = create_epidist_summary_stats(
median = 10,
Expand All @@ -86,7 +77,7 @@ test_that("calc_dist_params fails as expected extracting without sample size", {

test_that("calc_dist_params messages as expected without summary stats", {
expect_message(
params <- calc_dist_params(
params <- calc_dist_params( # nolint
prob_dist = "gamma",
summary_stats = create_epidist_summary_stats(mean = 5, median = 5)
),
Expand Down

0 comments on commit 173ff29

Please sign in to comment.