Skip to content

Commit 579da43

Browse files
committed
Update tests
1 parent 2ade6e9 commit 579da43

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_copy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,19 +429,22 @@ def test_deepcopy_reflexive_dict(self):
429429

430430
def test_deepcopy_keepalive(self):
431431
memo = {}
432+
memo[id(memo)] = []
432433
x = []
433434
y = copy.deepcopy(x, memo)
434435
self.assertIs(memo[id(memo)][0], x)
435436

436437
def test_deepcopy_dont_memo_immutable(self):
437438
memo = {}
439+
memo[id(memo)] = []
438440
x = [1, 2, 3, 4]
439441
y = copy.deepcopy(x, memo)
440442
self.assertEqual(y, x)
441443
# There's the entry for the new list, and the keep alive.
442444
self.assertEqual(len(memo), 2)
443445

444446
memo = {}
447+
memo[id(memo)] = []
445448
x = [(1, 2)]
446449
y = copy.deepcopy(x, memo)
447450
self.assertEqual(y, x)

0 commit comments

Comments
 (0)