Skip to content

Commit 135223e

Browse files
committed
Revert unneeded changes to unit tests.
1 parent 073409b commit 135223e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/test/test_gc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,8 @@ class Z:
10661066
# release references and create trash
10671067
del a, wr_cycle
10681068
gc.collect()
1069-
# In older versions of Python, the weakref was cleared by the
1070-
# gc. Now it is not cleared and so the callback is run.
1069+
# if called, it means there is a bug in the GC. The weakref should be
1070+
# cleared before Z dies.
10711071
callback.assert_not_called()
10721072
gc.enable()
10731073

Lib/test/test_weakref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ def check_len_cycles(self, dict_type, cons):
13141314
n2 = len(dct)
13151315
# one item may be kept alive inside the iterator
13161316
self.assertIn(n1, (0, 1))
1317-
self.assertIn(n2, (0, 1))
1317+
self.assertEqual(n2, 0)
13181318

13191319
def test_weak_keyed_len_cycles(self):
13201320
self.check_len_cycles(weakref.WeakKeyDictionary, lambda k: (k, 1))

0 commit comments

Comments
 (0)