Skip to content

Commit 2c34b4e

Browse files
committed
test: prevent soft scope problem
1 parent ace5c19 commit 2c34b4e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/test_evaluation.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,16 @@ end
226226
num_tests = 100
227227
n_features = 3
228228
for _ in 1:num_tests
229-
tree = gen_random_tree_fixed_size(20, only_basic_ops_operator, n_features, Float64)
230-
X = randn(Float64, n_features, 10)
231-
basic_eval = tree(X, only_basic_ops_operator)
232-
many_ops_eval = tree(X, many_ops_operators)
233-
@test (all(isnan, basic_eval) && all(isnan, many_ops_eval)) ||
234-
basic_eval many_ops_eval
229+
let tree = gen_random_tree_fixed_size(
230+
20, only_basic_ops_operator, n_features, Float64
231+
),
232+
X = randn(Float64, n_features, 10),
233+
basic_eval = tree(X, only_basic_ops_operator),
234+
many_ops_eval = tree(X, many_ops_operators)
235+
236+
@test (all(isnan, basic_eval) && all(isnan, many_ops_eval)) ||
237+
basic_eval many_ops_eval
238+
end
235239
end
236240
end
237241

0 commit comments

Comments
 (0)