def METHOD_NAME(input, output, all_optional):
    try:
        actual_output = validate_address(input, all_optional)
    except ValidationError as e:
        assert {
            k: ["".join(s for s in e) for e in v] for k, v in e.error_dict.items()
        } == output
    else:
        if output is True:
            assert actual_output == input
        else:
            assert output == actual_output