File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
tests/cyclops/evaluate/metrics/experimental Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,25 @@ def test_invalid_inputs():
180
180
):
181
181
MetricDict (DummyMetric (), postfix = 5 )
182
182
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
+
183
202
184
203
def test_metric_dict_computation ():
185
204
"""Test that using `MetricDict` works the same as using the individual metrics."""
You can’t perform that action at this time.
0 commit comments