Skip to content

Commit f2f1853

Browse files
committed
tests
1 parent d6c50cd commit f2f1853

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_deprecated.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ def __init__(self, hparams):
5050
self.hparams = hparams
5151
DeprecatedHparamsModel({})
5252

53+
with pytest.deprecated_call(match='will be removed in v1.3'):
54+
from pytorch_lightning.metrics.functional.classification import roc
55+
roc(pred=torch.tensor([0, 1]), target=torch.tensor([1, 1]), )
56+
57+
with pytest.deprecated_call(match='will be removed in v1.3'):
58+
from pytorch_lightning.metrics.functional.classification import _roc
59+
_roc(pred=torch.tensor([0, 1]), target=torch.tensor([0, 0]))
60+
61+
with pytest.deprecated_call(match='will be removed in v1.3'):
62+
from pytorch_lightning.metrics.functional.classification import multiclass_roc
63+
multiclass_roc(pred=torch.tensor([[1, 0], [0, 1]]), target=torch.tensor([0, 1]))
64+
65+
with pytest.deprecated_call(match='will be removed in v1.3'):
66+
from pytorch_lightning.metrics.functional.classification import average_precision
67+
average_precision(pred=torch.tensor([1]), target=torch.tensor([1]))
68+
69+
with pytest.deprecated_call(match='will be removed in v1.3'):
70+
from pytorch_lightning.metrics.functional.classification import precision_recall_curve
71+
precision_recall_curve(pred=torch.tensor([1]), target=torch.tensor([1]))
72+
73+
with pytest.deprecated_call(match='will be removed in v1.3'):
74+
from pytorch_lightning.metrics.functional.classification import multiclass_precision_recall_curve
75+
multiclass_precision_recall_curve(pred=torch.tensor([[1, 0], [0, 1]]), target=torch.tensor([0, 1]))
76+
5377

5478
def test_tbd_remove_in_v1_2_0():
5579
with pytest.deprecated_call(match='will be removed in v1.2'):

0 commit comments

Comments
 (0)