Skip to content

Commit 41b49c6

Browse files
committed
Minor improvement to test failure message when a best match test fails.
1 parent a8248a2 commit 41b49c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: jsonschema/tests/test_exceptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
class TestBestMatch(TestCase):
99
def best_match_of(self, instance, schema):
1010
errors = list(_LATEST_VERSION(schema).iter_errors(instance))
11+
msg = f"No errors found for {instance} under {schema!r}!"
12+
self.assertTrue(errors, msg=msg)
13+
1114
best = exceptions.best_match(iter(errors))
1215
reversed_best = exceptions.best_match(reversed(errors))
16+
1317
self.assertEqual(
1418
best._contents(),
1519
reversed_best._contents(),

0 commit comments

Comments
 (0)