def test_num_stepping_batches_infinite_training():
    """Test that stepping batches is "inf" when `Trainer` is configured for infinite training."""
    trainer = Trainer(max_steps=-1, max_epochs=-1)
    model = BoringModel()
    trainer._data_connector.attach_data(model)
    trainer.strategy.connect(model)
    assert trainer.estimated_stepping_batches == float("inf")
Test that stepping batches is "inf" when `Trainer` is configured for infinite training.
tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py