    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
Tests that registering Checkpointer subclasses works correctly.
tests/training/checkpointer_test.py