diff --git a/jsonschema/tests/test_exceptions.py b/jsonschema/tests/test_exceptions.py index 18be0589..4052b5f1 100644 --- a/jsonschema/tests/test_exceptions.py +++ b/jsonschema/tests/test_exceptions.py @@ -8,8 +8,12 @@ class TestBestMatch(TestCase): def best_match_of(self, instance, schema): errors = list(_LATEST_VERSION(schema).iter_errors(instance)) + msg = f"No errors found for {instance} under {schema!r}!" + self.assertTrue(errors, msg=msg) + best = exceptions.best_match(iter(errors)) reversed_best = exceptions.best_match(reversed(errors)) + self.assertEqual( best._contents(), reversed_best._contents(),