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

Skip to content

Commit a0fd37a

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sklearn/tree/tests/test_tree.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,10 +1619,12 @@ 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+
1625+
def _pickle_copy(obj):
1626+
return pickle.loads(pickle.dumps(obj))
1627+
for copy_func in [copy.copy, copy.deepcopy, _pickle_copy]:
16261628
for _, typename in CRITERIA_CLF.items():
16271629
criteria = typename(n_outputs, n_classes)
16281630
result = copy_func(criteria).__reduce__()

0 commit comments

Comments
 (0)
0