Skip to content

Commit

Permalink
Fix for python 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Sandve Alnæs committed Dec 16, 2015
1 parent 7661fc6 commit 433de2e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nbdime/tests/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def cut(li, *indices):
c = li.copy()
c = copy.deepcopy(li)
for q in reversed(sorted(indices)):
c.pop(q)
return c
Expand Down Expand Up @@ -34,12 +34,12 @@ def test_shallow_merge_lists_delete_no_conflict():
# both remove the same entry
b = [1, 3, 2, 7]
for i in range(len(b)):
l = b.copy()
r = b.copy()
l = copy.deepcopy(b)
r = copy.deepcopy(b)
l.pop(i)
r.pop(i)
m, lc, rc = merge(b, l, r)
e = b.copy(); e.pop(i)
e = copy.deepcopy(b); e.pop(i)
assert m == e
assert lc == []
assert rc == []
Expand All @@ -66,15 +66,15 @@ def test_shallow_merge_lists_insert_no_conflict():
# local adds an entry
b = [1]
l = b + [2]
r = b.copy()
r = copy.deepcopy(b)
m, lc, rc = merge(b, l, r)
assert m == [1, 2]
assert lc == []
assert rc == []

# remote adds an entry
b = [1]
l = b.copy()
l = copy.deepcopy(b)
r = b + [3]
m, lc, rc = merge(b, l, r)
assert m == [1, 3]
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_shallow_merge_lists_insert_no_conflict():
# local and remote adds the same entries interleaved within each base entry
b = [1, 3, 5]
l = [0, 1, 2, 3, 4, 5]
r = l.copy()
r = copy.deepcopy(l)
m, lc, rc = merge(b, l, r)
# whether this is a good result is disputable but this is how it currently works:
assert m == [0, 0, 1, 2, 2, 3, 4, 4, 5]
Expand Down

0 comments on commit 433de2e

Please sign in to comment.