Skip to content

Commit 3287b4f

Browse files
author
Steve Ayers
committed
Comments
1 parent f21f48a commit 3287b4f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/validate_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,16 @@ def _run_compilation_error_tests(self, msg: message.Message, expected: str):
253253
"""
254254
for label, v in get_default_validator():
255255
with self.subTest(label=label):
256-
with self.assertRaises(protovalidate.CompilationError) as cvce:
257-
v.collect_violations(msg)
258-
assert str(cvce.exception) == expected
259-
256+
# Test validate
260257
with self.assertRaises(protovalidate.CompilationError) as vce:
261258
v.validate(msg)
262259
assert str(vce.exception) == expected
263260

261+
# Test collect_violations
262+
with self.assertRaises(protovalidate.CompilationError) as cvce:
263+
v.collect_violations(msg)
264+
assert str(cvce.exception) == expected
265+
264266
def _compare_violations(self, actual: list[rules.Violation], expected: list[rules.Violation]) -> None:
265267
"""Compares two lists of violations. The violations are expected to be in the expected order also."""
266268
self.assertEqual(len(actual), len(expected))

0 commit comments

Comments
 (0)