8000 Fix test_tree for x64 builds and flake · scikit-learn/scikit-learn@ac24db4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ac24db4

Browse files
committed
Fix test_tree for x64 builds and flake
1 parent c9435c9 commit ac24db4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/tree/tests/test_tree.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,10 +1619,11 @@ def test_criterion_copy():
16191619
# Let's check whether copy of our criterion has the same type
16201620
# and properties as original
16211621
n_outputs = 3
1622-
n_classes = np.arange(3)
1622+
n_classes = np.arange(3, dtype=np.intp)
16231623
n_samples = 100
1624-
pickle_copy = lambda obj: pickle.loads(pickle.dumps(obj))
1625-
for copy_func in [copy.copy, copy.deepcopy, pickle_copy]:
1624+
def _pickle_copy(obj):
1625+
return pickle.loads(pickle.dumps(obj))
1626+
for copy_func in [copy.copy, copy.deepcopy, _pickle_copy]:
16261627
for _, typename in CRITERIA_CLF.items():
16271628
criteria = typename(n_outputs, n_classes)
16281629
result = copy_func(criteria).__reduce__()

0 commit comments

Comments
 (0)
0