From 7724ddd496c4cfb452edd59ff9bb9cd3d262c2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Mon, 2 Apr 2018 17:09:18 +0200 Subject: [PATCH] Improve hypothesis test error message --- tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index e1b4300..6a00bd0 100755 --- a/tests.py +++ b/tests.py @@ -639,7 +639,9 @@ def test_roundtrip(self, src, dst): patch = jsonpatch.JsonPatch.from_diff(src, dst, False) hypothesis.note('Patch: %s' % (patch,)) res = patch.apply(src) - self.assertEqual(res, dst) + message = '{src} + {patch} resulted in {res}; {dst} was expected'.format( + src=repr(src), patch=repr(patch), res=repr(res), dst=repr(dst)) + self.assertEqual(res, dst, message) if __name__ == '__main__':