mirror of
https://github.com/python/cpython.git
synced 2025-08-15 14:20: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 time
|
|||
import unittest
|
||||
import weakref
|
||||
from test import support
|
||||
from test.support import gc_collect
|
||||
|
||||
py_queue = support.import_fresh_module('queue', blocked=['_queue'])
|
||||
c_queue = support.import_fresh_module('queue', fresh=['_queue'])
|
||||
|
@ -588,6 +589,7 @@ class BaseSimpleQueueTest:
|
|||
q.put(C())
|
||||
for i in range(N):
|
||||
wr = weakref.ref(q.get())
|
||||
gc_collect() # For PyPy or other GCs.
|
||||
self.assertIsNone(wr())
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue