From 7dc40028496c0cd2abdd4604ecf6079ad8af22ab Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Tue, 5 Sep 2017 16:14:14 +0300 Subject: [PATCH] [python] fixed sklearn test on python 2.7 (#888) * fixed sklearn test on python 2.7 * commit to show that problem has been solved * come back to python 3.6 * removed warnings check --- tests/python_package_test/test_sklearn.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/python_package_test/test_sklearn.py b/tests/python_package_test/test_sklearn.py index 39415e30548e..fca5d442fdd2 100644 --- a/tests/python_package_test/test_sklearn.py +++ b/tests/python_package_test/test_sklearn.py @@ -3,7 +3,6 @@ import math import os import unittest -import warnings import lightgbm as lgb import numpy as np @@ -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),