def METHOD_NAME(
    self, strategy, use_dataset_creator
):
    class BatchLevelCallback(callbacks_lib.Callback):
        def on_train_batch_end(self, batch, logs=None):
            pass
    with self.assertRaisesRegex(
        ValueError, "Batch-level `Callback`s are not supported"
    ):
        callbacks = [BatchLevelCallback()]
        self._model_fit(
            strategy,
            callbacks=callbacks,
            use_dataset_creator=use_dataset_creator,
        )