You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing small dicts it returns the full diff, but on big structures it only returns those parts that differ (see #25). Sometimes (in the case of big, nested dicts with similar parts in them) this makes it hard to locate where those diffs happen though. The context might not be enough to find where the difference is.
Example
The test
importcopydefbig_structure(n):
"""Create a deeply nested tree of dicts"""ifn==0:
returndict()
return {
"a": big_structure(n-1),
"b": big_structure(n-1),
}
deftest_icdiffs():
expected_structure=big_structure(6)
real_structure=copy.deepcopy(expected_structure)
real_structure["a"]["b"]["b"]["a"]["a"]["b"] ="BOOM!"# create a differenceassertexpected_structure==real_structure
The result
As you can see it is very hard (if even possible) to retrieve the path of the differing field (("a", "b", "b", "a", "a", "b")).
This path is often is important to know to fix the error though
Suggested Solution
if pytest is called with -vvv (oder another appropriate level of verbosity) then the context could be disabled, showing the full diff.
The text was updated successfully, but these errors were encountered:
pytest-icdiff is awesome.
Problem
When testing small dicts it returns the full diff, but on big structures it only returns those parts that differ (see #25). Sometimes (in the case of big, nested dicts with similar parts in them) this makes it hard to locate where those diffs happen though. The context might not be enough to find where the difference is.
Example
The test
The result
As you can see it is very hard (if even possible) to retrieve the path of the differing field (
("a", "b", "b", "a", "a", "b")
).This path is often is important to know to fix the error though
Suggested Solution
if pytest is called with -vvv (oder another appropriate level of verbosity) then the context could be disabled, showing the full diff.
The text was updated successfully, but these errors were encountered: