Skip to content

Commit 2658dd6

Browse files
committed
Trailing commae.
1 parent 9b46129 commit 2658dd6

3 files changed

Lines changed: 28 additions & 34 deletions

File tree

jsonschema/tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def test_draft3_schema_draft4_validator(self):
7070
"anyOf": [
7171
{"minimum": 20},
7272
{"type": "string"},
73-
{"required": True}
74-
]
73+
{"required": True},
74+
],
7575
},
7676
"instances": [1],
7777
"error_format": "{error.message}",

jsonschema/tests/test_exceptions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def test_shallower_errors_are_better_matches(self):
2525
"foo" : {
2626
"minProperties" : 2,
2727
"properties" : {"bar" : {"type" : "object"}},
28-
}
29-
}
30-
}
28+
},
29+
},
30+
},
3131
)
3232
best = self.best_match(validator.iter_errors({"foo" : {"bar" : []}}))
3333
self.assertEqual(best.validator, "minProperties")
@@ -135,7 +135,7 @@ def test_nested_context_for_oneOf(self):
135135
{"type" : "string"},
136136
{
137137
"properties" : {
138-
"bar" : {"type" : "array"}
138+
"bar" : {"type" : "array"},
139139
},
140140
},
141141
],
@@ -329,7 +329,7 @@ def test_unset_error(self):
329329
"validator": "type",
330330
"validator_value": "string",
331331
"instance": 5,
332-
"schema": {"type": "string"}
332+
"schema": {"type": "string"},
333333
}
334334
# Just the message should show if any of the attributes are unset
335335
for attr in kwargs:

jsonschema/tests/test_validators.py

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_iter_errors(self):
8383
schema = {
8484
u"disallow" : u"array",
8585
u"enum" : [["a", "b", "c"], ["d", "e", "f"]],
86-
u"minItems" : 3
86+
u"minItems" : 3,
8787
}
8888

8989
got = (e.message for e in self.validator.iter_errors(instance, schema))
@@ -101,7 +101,7 @@ def test_iter_errors_multiple_failures_one_validator(self):
101101
"foo" : {u"type" : "string"},
102102
"bar" : {u"minItems" : 2},
103103
"baz" : {u"maximum" : 10, u"enum" : [2, 4, 6, 8]},
104-
}
104+
},
105105
}
106106

107107
errors = list(self.validator.iter_errors(instance, schema))
@@ -200,8 +200,8 @@ def test_anyOf(self):
200200
schema = {
201201
"anyOf": [
202202
{"minimum": 20},
203-
{"type": "string"}
204-
]
203+
{"type": "string"},
204+
],
205205
}
206206

207207
validator = Draft4Validator(schema)
@@ -268,11 +268,9 @@ def test_type(self):
268268
{"type": "integer"},
269269
{
270270
"type": "object",
271-
"properties": {
272-
"foo": {"enum": [2]}
273-
}
274-
}
275-
]
271+
"properties": {"foo": {"enum": [2]}},
272+
},
273+
],
276274
}
277275

278276
validator = Draft3Validator(schema)
@@ -344,7 +342,7 @@ def test_single_nesting(self):
344342
"foo" : {"type" : "string"},
345343
"bar" : {"minItems" : 2},
346344
"baz" : {"maximum" : 10, "enum" : [2, 4, 6, 8]},
347-
}
345+
},
348346
}
349347

350348
validator = Draft3Validator(schema)
@@ -384,10 +382,10 @@ def test_multiple_nesting(self):
384382
"properties" : {
385383
"bar" : {"required" : True},
386384
"baz" : {"minItems" : 2},
387-
}
388-
}
389-
}
390-
}
385+
},
386+
},
387+
},
388+
},
391389
}
392390

393391
validator = Draft3Validator(schema)
@@ -450,9 +448,7 @@ def test_recursive(self):
450448
},
451449
"type": "object",
452450
"required": ["root"],
453-
"properties": {
454-
"root": {"$ref": "#/definitions/node"},
455-
}
451+
"properties": {"root": {"$ref": "#/definitions/node"}},
456452
}
457453

458454
instance = {
@@ -465,8 +461,8 @@ def test_recursive(self):
465461
"ab": {
466462
"name": "ab",
467463
# missing "children"
468-
}
469-
}
464+
},
465+
},
470466
},
471467
},
472468
},
@@ -520,16 +516,14 @@ def test_recursive(self):
520516
"children",
521517
"patternProperties",
522518
"^.*$",
523-
"anyOf"
519+
"anyOf",
524520
],
525521
),
526522
)
527523

528524
def test_additionalProperties(self):
529525
instance = {"bar": "bar", "foo": 2}
530-
schema = {
531-
"additionalProperties" : {"type": "integer", "minimum": 5}
532-
}
526+
schema = {"additionalProperties" : {"type": "integer", "minimum": 5}}
533527

534528
validator = Draft3Validator(schema)
535529
errors = validator.iter_errors(instance)
@@ -546,8 +540,8 @@ def test_patternProperties(self):
546540
schema = {
547541
"patternProperties" : {
548542
"bar": {"type": "string"},
549-
"foo": {"minimum": 5}
550-
}
543+
"foo": {"minimum": 5},
544+
},
551545
}
552546

553547
validator = Draft3Validator(schema)
@@ -564,7 +558,7 @@ def test_additionalItems(self):
564558
instance = ["foo", 1]
565559
schema = {
566560
"items": [],
567-
"additionalItems" : {"type": "integer", "minimum": 5}
561+
"additionalItems" : {"type": "integer", "minimum": 5},
568562
}
569563

570564
validator = Draft3Validator(schema)
@@ -581,7 +575,7 @@ def test_additionalItems_with_items(self):
581575
instance = ["foo", "bar", 1]
582576
schema = {
583577
"items": [{}],
584-
"additionalItems" : {"type": "integer", "minimum": 5}
578+
"additionalItems" : {"type": "integer", "minimum": 5},
585579
}
586580

587581
validator = Draft3Validator(schema)

0 commit comments

Comments
 (0)