docstr: Tests that registering Checkpointer subclasses works correctly.
docstr_tok: ["Tests","that","registering","Checkpointer","subclasses","works","correctly","."]
code: def test_registered_subclass(self):
      """
      Tests that registering Checkpointer subclasses works correctly.
      """
  
      serialization_dir = str(self.TEST_DIR)
  
      @Checkpointer.register("checkpointer_subclass")
      class CheckpointerSubclass(Checkpointer):
          def __init__(self, x: int, y: int) -> None:
              super().__init__(serialization_dir)
              self.x = x
              self.y = y
  
      sub_inst = Checkpointer.from_params(
          Params({"type": "checkpointer_subclass", "x": 1, "y": 3})
      )
      assert sub_inst.__class__ == CheckpointerSubclass
      assert sub_inst.x == 1 and sub_inst.y == 3
  
file_path: allennlp/tests/training/checkpointer_test.py
imports: import os
  import time
  from typing import Optional
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.common.params import Params
  from allennlp.training import Checkpointer, Trainer
  from allennlp.training.trainer import TrainerCheckpoint
label_desc: Use image node_id 5 for calling the TestCheckpointer obj's underlying member method code with example usage: obj.test_registered_subclass() without return types