-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
topic: rewriterelated to the assertion rewrite mechanismrelated to the assertion rewrite mechanismtype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Description
Currently in some edge cases py.test returns utterly useless diffs for asserts on dicts, it doesn't provide the context needed to find which parts are differing in deeply nested dicts.
A better, and simpler, solution would be to use a json serializer to serialize the dicts and then use difflibs unified diff to generate the final diff. this solution will produce a diff in an easy to read format that people are familiar with and provides enough context to find the right place in the dict where changes need to be made.
any objects not json serializable in the dict can be adequately dealt with by using repr as serializer.
this whole function could be replaced with ~5 lines of code.
codewarrior0, srinivasreddy, mgaitan, rmariano, TimDaub and 18 more
Metadata
Metadata
Assignees
Labels
topic: rewriterelated to the assertion rewrite mechanismrelated to the assertion rewrite mechanismtype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch