class_docstr: Test class collection different tests for different properties parametrized by backend argument.
class_docstr_tok: ["Test","class","collection","different","tests","for","different","properties","parametrized","by","backend","argument","."]
docstr: Test class raises the expected errors.
docstr_tok: ["Test","class","raises","the","expected","errors","."]
code: def test_error_on_wrong_init(self, backend):
      """Test class raises the expected errors."""
      MeanAveragePrecision(backend=backend)  # no error
  
      with pytest.raises(
          ValueError,
          match="Expected argument `class_metrics` to be a boolean",
      ):
          MeanAveragePrecision(class_metrics=0, backend=backend)
  
imports: import contextlib
  import io
  import json
  from copy import deepcopy
  from functools import partial
  from itertools import product
  import numpy
  import pytest
  import torch
  from lightning_utilities import apply_to_collection
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  from torch import IntTensor, Tensor
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from torchmetrics.utilities.imports import _FASTER_COCO_EVAL_AVAILABLE, _PYCOCOTOOLS_AVAILABLE, _TORCHVISION_GREATER_EQUAL_0_8
  from unittests.detection import _DETECTION_BBOX, _DETECTION_SEGM, _DETECTION_VAL
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling the TestMapProperties obj's underlying member method code with example usage: obj.test_error_on_wrong_init(backend) without return types