def test_oneof_config_validation(self):
        class TestConf(schema.Schema):
            item = schema.ArrayItem(
                title="Hungry",
                description="Are you hungry?",
                items=schema.OneOfItem(
                    items=(
                        schema.StringItem(title="Yes", enum=["yes"]),
                        schema.StringItem(title="No", enum=["no"]),
                    )
                ),
            )

        try:
            jsonschema.validate({"item": ["no"]}, TestConf.serialize())
        except jsonschema.exceptions.ValidationError as exc:
            self.fail("ValidationError raised: {}".format(exc))

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": ["maybe"]}, TestConf.serialize())
        if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0"):
            self.assertIn("'maybe'", excinfo.exception.message)
            self.assertIn("is not one of", excinfo.exception.message)
            self.assertIn("'yes'", excinfo.exception.message)
        else:
            self.assertIn(
                "is not valid under any of the given schemas", excinfo.exception.message
            )

        with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
            jsonschema.validate({"item": 2}, TestConf.serialize())
        self.assertIn("is not of type", excinfo.exception.message)