Skip to content

Commit d2f935d

Browse files
authored
Fixed failing test_roc_auc.py::test_check_compute_fn test (#3316)
Test is failing due to scikit-learn changed: ValueError exception -> UndefinedMetricWarning between 1.15 and 1.16
1 parent a3d691c commit d2f935d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/ignite/metrics/test_roc_auc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
import sklearn
66
import torch
7+
from sklearn.exceptions import UndefinedMetricWarning
78
from sklearn.metrics import roc_auc_score
89

910
import ignite.distributed as idist
@@ -112,7 +113,7 @@ def test_check_compute_fn():
112113
em = ROC_AUC(check_compute_fn=True)
113114

114115
em.reset()
115-
with pytest.warns(EpochMetricWarning, match=r"Probably, there can be a problem with `compute_fn`"):
116+
with pytest.warns((UndefinedMetricWarning, EpochMetricWarning), match=r"Only one class.+present in y_true"):
116117
em.update(output)
117118

118119
em = ROC_AUC(check_compute_fn=False)

0 commit comments

Comments
 (0)