def test_parse_args_parsing(cli_args, expected):
    """Test parsing simple types and None optionals not modified."""
    cli_args = cli_args.split(" ") if cli_args else []
    parser = LightningArgumentParser(add_help=False)
    parser.add_lightning_class_args(Trainer, None)
    with patch("sys.argv", ["any.py"] + cli_args):
        args = parser.parse_args()

    for k, v in expected.items():
        assert getattr(args, k) == v
    assert Trainer.from_argparse_args(args)
Test parsing simple types and None optionals not modified.
tests/core/utilities/test_lightning_cli.py