Skip to content

Commit

Permalink
fixing final tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seperman committed Apr 8, 2024
1 parent f84aaad commit 93fd654
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deepdiff/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _get_item_length(item, parents_ids=frozenset([])):
subitem = new_subitem

# internal keys such as _numpy_paths should not count towards the distance
if isinstance(key, strings) and (key.startswith('_') or key == 'deep_distance'):
if isinstance(key, strings) and (key.startswith('_') or key == 'deep_distance' or key == 'new_path'):
continue

item_id = id(subitem)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def test_cache_deeply_nested_b(self, nested_b_t1, nested_b_t2, nested_b_result):

stats = diff.get_stats()
expected_stats = {
'PASSES COUNT': 104,
'DIFF COUNT': 288,
'PASSES COUNT': 110,
'DIFF COUNT': 306,
'DISTANCE CACHE HIT COUNT': 0,
'MAX PASS LIMIT REACHED': False,
'MAX DIFF LIMIT REACHED': False
Expand Down
2 changes: 1 addition & 1 deletion tests/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_get_distance_works_event_when_ignore_order_and_different_hasher(self):
diff = DeepDiff(t1, t2, ignore_order=True, get_deep_distance=True,
cache_size=100, hasher=sha256hex)
dist = diff['deep_distance']
assert str(dist)[:4] == '0.55'
assert str(dist)[:4] == '0.44'

def test_get_distance_does_not_care_about_the_size_of_string(self):
t1 = ["a", "b"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ignore_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,8 @@ def test_stats_that_include_distance_cache_hits(self):

diff = DeepDiff(t1, t2, ignore_order=True, cache_size=5000, cutoff_intersection_for_pairs=1)
expected = {
'PASSES COUNT': 6,
'DIFF COUNT': 33,
'PASSES COUNT': 7,
'DIFF COUNT': 37,
'DISTANCE CACHE HIT COUNT': 0,
'MAX PASS LIMIT REACHED': False,
'MAX DIFF LIMIT REACHED': False,
Expand Down

0 comments on commit 93fd654

Please sign in to comment.