Skip to content

Commit 0acd717

Browse files
authored
👽 Drop np_version import (#745)
Drop `from sklearn.utils.fixes import np_version` The specification for `np_version` changed in `scikit-learn`, leading to an error when tests ran. However, the test was whether the `numpy` version was less than `1.7.0`, which is outside the minimum version specified in `setup.py` and `requirements.txt`
1 parent 86f5418 commit 0acd717

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

imblearn/metrics/tests/test_classification.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from sklearn import svm
1515

1616
from sklearn.preprocessing import label_binarize
17-
from sklearn.utils.fixes import np_version
1817
from sklearn.utils.validation import check_random_state
1918
from sklearn.utils._testing import assert_allclose
2019
from sklearn.utils._testing import assert_array_equal
@@ -413,12 +412,8 @@ def test_classification_report_imbalanced_multiclass_with_unicode_label():
413412
"red¢ 0.42 0.90 0.55 0.57 0.70 0.51 20 avg / total "
414413
"0.51 0.53 0.80 0.47 0.58 0.40 75"
415414
)
416-
if np_version[:3] < (1, 7, 0):
417-
with pytest.raises(RuntimeError, match="NumPy < 1.7.0"):
418-
classification_report_imbalanced(y_true, y_pred)
419-
else:
420-
report = classification_report_imbalanced(y_true, y_pred)
421-
assert _format_report(report) == expected_report
415+
report = classification_report_imbalanced(y_true, y_pred)
416+
assert _format_report(report) == expected_report
422417

423418

424419
def test_classification_report_imbalanced_multiclass_with_long_string_label():

0 commit comments

Comments
 (0)