def METHOD_NAME(schema):
    data = {"message": "hello_world"}
    message = "data must contain ['username'] properties"
    with pytest.raises(
        exceptions.SchemaValidationError,
        match=re.escape(f"Failed schema validation. Error: {message}, Path: ['data'], Data: {data}"),
    ) as e:
        validate(event=data, schema=schema)
    assert str(e.value) == e.value.message
    assert e.value.validation_message == message
    assert e.value.name == "data"
    assert e.value.path is not None
    assert e.value.value == data
    assert e.value.definition == schema
    assert e.value.rule == "required"
    assert e.value.rule_definition == schema.get("required")