Skip to content

Commit

Permalink
[python] fixed sklearn test on python 2.7 (#888)
Browse files Browse the repository at this point in the history
* fixed sklearn test on python 2.7

* commit to show that problem has been solved

* come back to python 3.6

* removed warnings check
  • Loading branch information
StrikerRUS authored and guolinke committed Oct 9, 2017
1 parent e78cfa8 commit 7dc4002
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tests/python_package_test/test_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import math
import os
import unittest
import warnings

import lightgbm as lgb
import numpy as np
Expand Down Expand Up @@ -174,13 +173,6 @@ def test_sklearn_backward_compatibility(self):
y_pred_2 = clf_2.fit(X_train, y_train).predict_proba(X_test)
np.testing.assert_allclose(y_pred_1, y_pred_2)

# Tests that warnings were raised
with warnings.catch_warnings(record=True) as w:
clf_1.get_params()
clf_2.set_params(nthread=-1).fit(X_train, y_train)
self.assertEqual(len(w), 2)
self.assertTrue(issubclass(w[-1].category, Warning))

def test_sklearn_integration(self):
# we cannot use `check_estimator` directly since there is no skip test mechanism
for name, estimator in ((lgb.sklearn.LGBMClassifier.__name__, lgb.sklearn.LGBMClassifier),
Expand Down

0 comments on commit 7dc4002

Please sign in to comment.