def test_property_global_step():
    """Test that the global_step in LightningModule is accessible via the Trainer."""
    model = BoringModel()
    assert model.global_step == 0

    trainer = Mock(global_step=123)
    model.trainer = trainer
    assert model.global_step == 123
Test that the global_step in LightningModule is accessible via the Trainer.
tests/tests_pytorch/core/test_lightning_module.py