code: def test_mmdet_bbox_models_light_finalizes_metrics_on_test_epoch_end(
      self,
      ds,
      model_type,
      pretrained,
      cfg_options,
      samples_source,
      request,
  ):
      with torch.set_grad_enabled(False):
          _, _, model = self.dls_model(
              ds,
              model_type,
              pretrained,
              cfg_options,
              samples_source,
              request,
          )
  
          class LitModel(model_type.lightning.ModelAdapter):
              def __init__(self, model, metrics=None):
                  super(LitModel, self).__init__(model, metrics)
                  self.was_finalize_metrics_called = False
  
              def configure_optimizers(self):
                  return Adam(self.parameters(), lr=1e-4)
  
              def finalize_metrics(self):
                  self.was_finalize_metrics_called = True
  
          light_model = LitModel(model)
  
          light_model.test_epoch_end(None)
  
          assert light_model.was_finalize_metrics_called == True
  
file_path: icevision/tests/models/mmdet/test_model.py
imports: import pytest
  import random
  from icevision.all import *
label_desc: Use image node_id 11 for calling the TestBboxModels obj's underlying member method code with example usage: obj.test_mmdet_bbox_models_light_finalizes_metrics_on_test_epoch_end(ds, model_type, pretrained, cfg_options, samples_source, request) and returns: Adam