code: def testCheckpointCallback(self):
      tmpdir = tempfile.mkdtemp()
      self.addCleanup(lambda: shutil.rmtree(tmpdir))
  
      def train_fn(config):
          module = _MockModule(10.0, 20.0)
          trainer = pl.Trainer(
              max_epochs=10,
              callbacks=[
                  TuneReportCheckpointCallback(
                      filename="trainer.ckpt", on=["train_epoch_end"]
                  )
              ],
          )
          trainer.fit(module)
  
      checkpoint_config = CheckpointConfig(num_to_keep=100)
      tuner = tune.Tuner(
          train_fn,
          run_config=train.RunConfig(
              stop={TRAINING_ITERATION: 10},
              storage_path=tmpdir,
              checkpoint_config=checkpoint_config,
          ),
      )
      results = tuner.fit()
  
      # 1 checkpoint per epoch
      self.assertEqual(len(results[0].best_checkpoints), 10)
  
imports: import shutil
  import tempfile
  import unittest
  import pytorch_lightning
  from ray.train import CheckpointConfig
  import torch
  from ray.air.constants import TRAINING_ITERATION
  from torch.utils.data import DataLoader, Dataset
  from ray import train, tune
  from ray.tune.integration.pytorch_lightning import TuneReportCheckpointCallback
label_desc: Use image node_id 5 for calling the PyTorchLightningIntegrationTest obj's underlying member method code with example usage: obj.testCheckpointCallback() without return types