diff options
author | Stefan Kögl <stefan@skoegl.net> | 2018-04-02 17:09:18 +0200 |
---|---|---|
committer | Stefan Kögl <stefan@skoegl.net> | 2018-04-02 17:09:18 +0200 |
commit | 7724ddd496c4cfb452edd59ff9bb9cd3d262c2b8 (patch) | |
tree | 914583938f0f42580f1195d1ffa82bf646deacf5 | |
parent | f301608cba9df042b6121e011ce188658109faf9 (diff) | |
download | python-json-patch-7724ddd496c4cfb452edd59ff9bb9cd3d262c2b8.tar.gz |
Improve hypothesis test error message
-rwxr-xr-x | tests.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -639,7 +639,9 @@ if hypothesis is not None: 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__': |