Skip to content

Commit 101ed8c

Browse files
committed
Removed useless setUp.
1 parent 277720d commit 101ed8c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

tests.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,6 @@ def test_uses_pprint(self):
450450

451451

452452
class TestValidationErrorDetails(unittest.TestCase):
453-
def setUp(self):
454-
self.validator = Draft3Validator({})
455-
456453
# TODO: These really need unit tests for each individual validator, rather
457454
# than just these higher level tests.
458455
def test_anyOf(self):
@@ -509,7 +506,8 @@ def test_type(self):
509506
]
510507
}
511508

512-
errors = list(self.validator.iter_errors(instance, schema))
509+
validator = Draft3Validator(schema)
510+
errors = list(validator.iter_errors(instance))
513511
self.assertEqual(len(errors), 1)
514512
e = errors[0]
515513

@@ -555,7 +553,8 @@ def test_single_nesting(self):
555553
}
556554
}
557555

558-
errors = self.validator.iter_errors(instance, schema)
556+
validator = Draft3Validator(schema)
557+
errors = validator.iter_errors(instance)
559558
e1, e2, e3, e4 = sorted_errors(errors)
560559

561560
self.assertEqual(list(e1.path), ["bar"])
@@ -587,7 +586,8 @@ def test_multiple_nesting(self):
587586
}
588587
}
589588

590-
errors = self.validator.iter_errors(instance, schema)
589+
validator = Draft3Validator(schema)
590+
errors = validator.iter_errors(instance)
591591
e1, e2, e3, e4, e5, e6 = sorted_errors(errors)
592592

593593
self.assertEqual(list(e1.path), [])
@@ -610,7 +610,8 @@ def test_additionalProperties(self):
610610
"additionalProperties" : {"type": "integer", "minimum": 5}
611611
}
612612

613-
errors = self.validator.iter_errors(instance, schema)
613+
validator = Draft3Validator(schema)
614+
errors = validator.iter_errors(instance)
614615
e1, e2 = sorted_errors(errors)
615616

616617
self.assertEqual(list(e1.path), ["bar"])
@@ -628,7 +629,8 @@ def test_patternProperties(self):
628629
}
629630
}
630631

631-
errors = self.validator.iter_errors(instance, schema)
632+
validator = Draft3Validator(schema)
633+
errors = validator.iter_errors(instance)
632634
e1, e2 = sorted_errors(errors)
633635

634636
self.assertEqual(list(e1.path), ["bar"])
@@ -644,7 +646,8 @@ def test_additionalItems(self):
644646
"additionalItems" : {"type": "integer", "minimum": 5}
645647
}
646648

647-
errors = self.validator.iter_errors(instance, schema)
649+
validator = Draft3Validator(schema)
650+
errors = validator.iter_errors(instance)
648651
e1, e2 = sorted_errors(errors)
649652

650653
self.assertEqual(list(e1.path), [0])

0 commit comments

Comments
 (0)