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

Fix test flakiness #1351

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions pkg/caret/tests/testthat/test_Dummies.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ check_dummies <- function(x, expected = NULL) {


test_that("Good names for dummies with reocurring patterns", {
# 200 all but guarantees (99.999% chance) 1:15 all represented, #1350
data = data.frame(
matrix(
rep(
as.factor(sample.int(15, size = 100, replace = TRUE, prob = rep(1 / 15, 15))
as.factor(sample.int(15, size = 200, replace = TRUE, prob = rep(1 / 15, 15))
),
15
),
Expand All @@ -137,4 +138,3 @@ test_that("Good names for dummies with reocurring patterns", {
res_names_lvls <- colnames(predict(essai_dummyVars, data))
expect_true(all(exp_names_lvls %in% res_names_lvls))
})