Skip to content

Commit 8574c31

Browse files
committed
update test
1 parent 0abfef4 commit 8574c31

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/cyclops/evaluate/metrics/experimental/test_metric_dict.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,25 @@ def test_invalid_inputs():
180180
):
181181
MetricDict(DummyMetric(), postfix=5)
182182

183+
with pytest.warns(
184+
UserWarning,
185+
match="Found object in `metrics` that is not `Metric` or `TorchMetric`. "
186+
"This object will be ignored: not_a_metric",
187+
):
188+
MetricDict((DummyMetric(), "not_a_metric"))
189+
with pytest.warns(
190+
UserWarning,
191+
match="Found object in `other_metrics` that is not `Metric` or `TorchMetric`. "
192+
"This object will be ignored: not_a_metric",
193+
):
194+
MetricDict(DummyMetric(), DummyListStateMetric(), "not_a_metric")
195+
with pytest.warns(
196+
UserWarning,
197+
match="Found object in `kwargs` that is not `Metric` or `TorchMetric`. "
198+
"This object will be ignored: 5",
199+
):
200+
MetricDict(dummy=DummyMetric(), not_a_metric=5)
201+
183202

184203
def test_metric_dict_computation():
185204
"""Test that using `MetricDict` works the same as using the individual metrics."""

0 commit comments

Comments
 (0)