Skip to content

Commit 93fd654

Browse files
committed
fixing final tests
1 parent f84aaad commit 93fd654

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

deepdiff/distance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _get_item_length(item, parents_ids=frozenset([])):
156156
subitem = new_subitem
157157

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

162162
item_id = id(subitem)

tests/test_cache.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def test_cache_deeply_nested_b(self, nested_b_t1, nested_b_t2, nested_b_result):
6666

6767
stats = diff.get_stats()
6868
expected_stats = {
69-
'PASSES COUNT': 104,
70-
'DIFF COUNT': 288,
69+
'PASSES COUNT': 110,
70+
'DIFF COUNT': 306,
7171
'DISTANCE CACHE HIT COUNT': 0,
7272
'MAX PASS LIMIT REACHED': False,
7373
'MAX DIFF LIMIT REACHED': False

tests/test_distance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_get_distance_works_event_when_ignore_order_and_different_hasher(self):
165165
diff = DeepDiff(t1, t2, ignore_order=True, get_deep_distance=True,
166166
cache_size=100, hasher=sha256hex)
167167
dist = diff['deep_distance']
168-
assert str(dist)[:4] == '0.55'
168+
assert str(dist)[:4] == '0.44'
169169

170170
def test_get_distance_does_not_care_about_the_size_of_string(self):
171171
t1 = ["a", "b"]

tests/test_ignore_order.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,8 @@ def test_stats_that_include_distance_cache_hits(self):
720720

721721
diff = DeepDiff(t1, t2, ignore_order=True, cache_size=5000, cutoff_intersection_for_pairs=1)
722722
expected = {
723-
'PASSES COUNT': 6,
724-
'DIFF COUNT': 33,
723+
'PASSES COUNT': 7,
724+
'DIFF COUNT': 37,
725725
'DISTANCE CACHE HIT COUNT': 0,
726726
'MAX PASS LIMIT REACHED': False,
727727
'MAX DIFF LIMIT REACHED': False,

0 commit comments

Comments
 (0)