def METHOD_NAME(self, schema, expected_path):
    to_validate = {"bar": [1, 2, 3]}
    with pytest.raises(jsonschema.SchemaError) as err:
        validate_dict(to_validate, schema, "foobar")
    assert check_error_or_warning(
        err,
        f"The foobar schema is malformed{expected_path}: Additional properties are not allowed ('foo' was unexpected)",
    )