diff --git a/jsonschema/tests/test_cli.py b/jsonschema/tests/test_cli.py index 8095da9..09a2f6b 100644 --- a/jsonschema/tests/test_cli.py +++ b/jsonschema/tests/test_cli.py @@ -70,8 +70,8 @@ class TestCLI(unittest.TestCase): "anyOf": [ {"minimum": 20}, {"type": "string"}, - {"required": True} - ] + {"required": True}, + ], }, "instances": [1], "error_format": "{error.message}", diff --git a/jsonschema/tests/test_exceptions.py b/jsonschema/tests/test_exceptions.py index 85b85c0..c555528 100644 --- a/jsonschema/tests/test_exceptions.py +++ b/jsonschema/tests/test_exceptions.py @@ -25,9 +25,9 @@ class TestBestMatch(unittest.TestCase): "foo" : { "minProperties" : 2, "properties" : {"bar" : {"type" : "object"}}, - } - } - } + }, + }, + }, ) best = self.best_match(validator.iter_errors({"foo" : {"bar" : []}})) self.assertEqual(best.validator, "minProperties") @@ -135,7 +135,7 @@ class TestBestMatch(unittest.TestCase): {"type" : "string"}, { "properties" : { - "bar" : {"type" : "array"} + "bar" : {"type" : "array"}, }, }, ], @@ -329,7 +329,7 @@ class TestErrorInitReprStr(unittest.TestCase): "validator": "type", "validator_value": "string", "instance": 5, - "schema": {"type": "string"} + "schema": {"type": "string"}, } # Just the message should show if any of the attributes are unset for attr in kwargs: diff --git a/jsonschema/tests/test_validators.py b/jsonschema/tests/test_validators.py index f281161..f1dc831 100644 --- a/jsonschema/tests/test_validators.py +++ b/jsonschema/tests/test_validators.py @@ -83,7 +83,7 @@ class TestIterErrors(unittest.TestCase): schema = { u"disallow" : u"array", u"enum" : [["a", "b", "c"], ["d", "e", "f"]], - u"minItems" : 3 + u"minItems" : 3, } got = (e.message for e in self.validator.iter_errors(instance, schema)) @@ -101,7 +101,7 @@ class TestIterErrors(unittest.TestCase): "foo" : {u"type" : "string"}, "bar" : {u"minItems" : 2}, "baz" : {u"maximum" : 10, u"enum" : [2, 4, 6, 8]}, - } + }, } errors = list(self.validator.iter_errors(instance, schema)) @@ -200,8 +200,8 @@ class TestValidationErrorDetails(unittest.TestCase): schema = { "anyOf": [ {"minimum": 20}, - {"type": "string"} - ] + {"type": "string"}, + ], } validator = Draft4Validator(schema) @@ -268,11 +268,9 @@ class TestValidationErrorDetails(unittest.TestCase): {"type": "integer"}, { "type": "object", - "properties": { - "foo": {"enum": [2]} - } - } - ] + "properties": {"foo": {"enum": [2]}}, + }, + ], } validator = Draft3Validator(schema) @@ -344,7 +342,7 @@ class TestValidationErrorDetails(unittest.TestCase): "foo" : {"type" : "string"}, "bar" : {"minItems" : 2}, "baz" : {"maximum" : 10, "enum" : [2, 4, 6, 8]}, - } + }, } validator = Draft3Validator(schema) @@ -384,10 +382,10 @@ class TestValidationErrorDetails(unittest.TestCase): "properties" : { "bar" : {"required" : True}, "baz" : {"minItems" : 2}, - } - } - } - } + }, + }, + }, + }, } validator = Draft3Validator(schema) @@ -450,9 +448,7 @@ class TestValidationErrorDetails(unittest.TestCase): }, "type": "object", "required": ["root"], - "properties": { - "root": {"$ref": "#/definitions/node"}, - } + "properties": {"root": {"$ref": "#/definitions/node"}}, } instance = { @@ -465,8 +461,8 @@ class TestValidationErrorDetails(unittest.TestCase): "ab": { "name": "ab", # missing "children" - } - } + }, + }, }, }, }, @@ -520,16 +516,14 @@ class TestValidationErrorDetails(unittest.TestCase): "children", "patternProperties", "^.*$", - "anyOf" + "anyOf", ], ), ) def test_additionalProperties(self): instance = {"bar": "bar", "foo": 2} - schema = { - "additionalProperties" : {"type": "integer", "minimum": 5} - } + schema = {"additionalProperties" : {"type": "integer", "minimum": 5}} validator = Draft3Validator(schema) errors = validator.iter_errors(instance) @@ -546,8 +540,8 @@ class TestValidationErrorDetails(unittest.TestCase): schema = { "patternProperties" : { "bar": {"type": "string"}, - "foo": {"minimum": 5} - } + "foo": {"minimum": 5}, + }, } validator = Draft3Validator(schema) @@ -564,7 +558,7 @@ class TestValidationErrorDetails(unittest.TestCase): instance = ["foo", 1] schema = { "items": [], - "additionalItems" : {"type": "integer", "minimum": 5} + "additionalItems" : {"type": "integer", "minimum": 5}, } validator = Draft3Validator(schema) @@ -581,7 +575,7 @@ class TestValidationErrorDetails(unittest.TestCase): instance = ["foo", "bar", 1] schema = { "items": [{}], - "additionalItems" : {"type": "integer", "minimum": 5} + "additionalItems" : {"type": "integer", "minimum": 5}, } validator = Draft3Validator(schema)