Skip to content

Conversation

@berendkleinhaneveld
Copy link
Collaborator

@berendkleinhaneveld berendkleinhaneveld commented Jan 16, 2023

Fixes #16 .

I didn't yet try to minimise the test, but simply adding/removing an item from a dict seemed to work fine, even though I would also expect that to hit the line I changed in diff.py?

Seems that line 98-99 of diff.py were not covered in the tests. And those lines can be triggered by removing an item from a dict.

Weird thing is: #16 contains a failing example where an item is added to a dict... I'm still a bit confused... And that happens because of how the diffs between lists are calculated (line 88 kind of switches input/output).

@Korijn
Copy link
Collaborator

Korijn commented Jan 16, 2023

Maybe the problem lies in the way recursive calls are made?

Also added pytest-cov to get an idea of what the code coverage is.
Apparently lines 98-99 of diff.py were exactly *not* covered.
Simply adding a test where an item is removed from a dict hits those
two lines.
Bonus: pytest-watch in dev tools.
@berendkleinhaneveld berendkleinhaneveld changed the title Fix for nested dict Fix for removing items from dicts Jan 16, 2023
@Korijn Korijn merged commit a7d91e7 into master Jan 16, 2023
@Korijn Korijn deleted the fix-nested-dict branch January 16, 2023 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fails to understand new key in an existing object inside a list

3 participants