code: def test__training_step__flow_dict(tmpdir):
      """Tests that only training_step can be used."""
  
      class TestModel(DeterministicModel):
          def training_step(self, batch, batch_idx):
              acc = self.step(batch, batch_idx)
              acc = acc + batch_idx
              self.training_step_called = True
              return {
                  "loss": acc,
                  "random_things": [1, "a", torch.tensor(2)],
              }
  
          def backward(self, loss):
              return LightningModule.backward(self, loss)
  
      model = TestModel()
      model.val_dataloader = None
  
      trainer = Trainer(
          default_root_dir=tmpdir,
          limit_train_batches=2,
          limit_val_batches=2,
          max_epochs=2,
          log_every_n_steps=1,
          enable_model_summary=False,
      )
      trainer.fit(model)
  
      # make sure correct steps were called
      assert model.training_step_called
  
file_path: pytorch-lightning/tests/tests_pytorch/loops/test_training_loop_flow_dict.py
imports: import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.core.module import LightningModule
  from tests_pytorch.helpers.deterministic_model import DeterministicModel
label_desc: Use image node_id 1 for calling a global function with example usage: test__training_step__flow_dict(tmpdir) and returns: dict, LightningModule