8000 [MRG + 1] update test_common.py deprecation warning (#7024) · scikit-learn/scikit-learn@536b26a · GitHub
[go: up one dir, main page]

Skip to content

Commit 536b26a

Browse files
blakefleiamueller
authored andcommitted
[MRG + 1] update test_common.py deprecation warning (#7024)
* update test_common.py deprecation warning * Updated test_common.test_get_params_invariance to omit deprecation warnings on deprecated classes per issue 7006
1 parent 89e0735 commit 536b26a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sklearn/tests/test_common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ def test_transformer_n_iter():
222222
else:
223223
yield check_transformer_n_iter, name, estimator
224224

225-
226225
def test_get_params_invariance():
227226
# Test for estimators that support get_params, that
228227
# get_params(deep=False) is a subset of get_params(deep=True)
@@ -232,8 +231,8 @@ def test_get_params_invariance():
232231
include_other=True)
233232
for name, Estimator in estimators:
234233
if hasattr(Estimator, 'get_params'):
235-
# The ProjectedGradientNMF class is deprecated
236-
if issubclass(Estimator, ProjectedGradientNMF):
234+
# If class is deprecated, ignore deprecated warnings
235+
if hasattr(Estimator.__init__, "deprecated_original"):
237236
with ignore_warnings():
238237
yield check_get_params_invariance, name, Estimator
239238
else:

0 commit comments

Comments
 (0)
0