def test_connector_defaults_match_trainer_defaults():
    """Test that the default values for the init arguments of AcceleratorConnector match the ones in Trainer."""

    def get_defaults(cls):
        init_signature = inspect.signature(cls)
        return {k: v.default for k, v in init_signature.parameters.items()}

    trainer_defaults = get_defaults(Trainer)
    connector_defaults = get_defaults(_AcceleratorConnector)

    # defaults should match on the intersection of argument names
    for name, connector_default in connector_defaults.items():
        assert connector_default == trainer_defaults[name]
Test that the default values for the init arguments of AcceleratorConnector match the ones in Trainer.
tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py