def test_evaluate(self):
        """Test using the metric in the same way as Evalutor."""

        # Test with score (use score instead of label if score exists)
        metric = MultiTasksMetric(self.task_metrics)
        metric.process(None, self.preds)
        results = metric.evaluate(2)
        self.assertIsInstance(results, dict)
        self.assertAlmostEqual(results['task0_accuracy/top1'], 100)
        self.assertGreater(results['task1_single-label/precision'], 0)

        # Test nested
        metric = MultiTasksMetric(self.task_metrics2)
        metric.process(None, self.pred2)
        results = metric.evaluate(2)
        self.assertIsInstance(results, dict)
        self.assertGreater(results['task1_task10_single-label/precision'], 0)
        self.assertGreater(results['task1_task11_accuracy/top1'], 0)

        # Test with without any ground truth value
        metric = MultiTasksMetric(self.task_metrics)
        metric.process(None, self.pred3)
        results = metric.evaluate(2)
        self.assertIsInstance(results, dict)
        self.assertEqual(results['task0_Accuracy'], 0)
Test using the metric in the same way as Evalutor.
tests/test_evaluation/test_metrics/test_multi_task_metrics.py