mirror of
https://github.com/python/cpython.git
synced 2025-08-08 02:48:55 +00:00
[3.9] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005). (GH-28028)
(cherry picked from commit 2a8127cafe
)
This commit is contained in:
parent
dab74d68e3
commit
330aabbbbe
36 changed files with 143 additions and 15 deletions
|
@ -7,6 +7,7 @@ import abc
|
|||
from operator import le, lt, ge, gt, eq, ne
|
||||
|
||||
import unittest
|
||||
from test import support
|
||||
|
||||
order_comparisons = le, lt, ge, gt
|
||||
equality_comparisons = eq, ne
|
||||
|
@ -816,6 +817,7 @@ class TestCopy(unittest.TestCase):
|
|||
self.assertEqual(v[c], d)
|
||||
self.assertEqual(len(v), 2)
|
||||
del c, d
|
||||
support.gc_collect() # For PyPy or other GCs.
|
||||
self.assertEqual(len(v), 1)
|
||||
x, y = C(), C()
|
||||
# The underlying containers are decoupled
|
||||
|
@ -845,6 +847,7 @@ class TestCopy(unittest.TestCase):
|
|||
self.assertEqual(v[a].i, b.i)
|
||||
self.assertEqual(v[c].i, d.i)
|
||||
del c
|
||||
support.gc_collect() # For PyPy or other GCs.
|
||||
self.assertEqual(len(v), 1)
|
||||
|
||||
def test_deepcopy_weakvaluedict(self):
|
||||
|
@ -868,6 +871,7 @@ class TestCopy(unittest.TestCase):
|
|||
self.assertIs(t, d)
|
||||
del x, y, z, t
|
||||
del d
|
||||
support.gc_collect() # For PyPy or other GCs.
|
||||
self.assertEqual(len(v), 1)
|
||||
|
||||
def test_deepcopy_bound_method(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue