Skip to content

Commit

Permalink
Fixed failing test_roc_auc.py::test_check_compute_fn test
Browse files Browse the repository at this point in the history
Test is failing due to scikit-learn changed:
ValueError exception -> UndefinedMetricWarning between 1.15 and 1.16
  • Loading branch information
vfdev-5 committed Dec 16, 2024
1 parent a3d691c commit 22784b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/ignite/metrics/test_roc_auc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest
import sklearn
import torch
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.metrics import roc_auc_score

import ignite.distributed as idist
Expand Down Expand Up @@ -112,7 +113,7 @@ def test_check_compute_fn():
em = ROC_AUC(check_compute_fn=True)

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

em = ROC_AUC(check_compute_fn=False)
Expand Down

0 comments on commit 22784b7

Please # to comment.