MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_references

Method test_references

Lib/test/test_queue.py:997–1010  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

995 self.assertEqual(sorted(results), inputs)
996
997 def test_references(self):
998 # The queue should lose references to each item as soon as
999 # it leaves the queue.
1000 class C:
1001 pass
1002
1003 N = 20
1004 q = self.q
1005 for i in range(N):
1006 q.put(C())
1007 for i in range(N):
1008 wr = weakref.ref(q.get())
1009 gc_collect() # For PyPy or other GCs.
1010 self.assertIsNone(wr())
1011
1012
1013class PySimpleQueueTest(BaseSimpleQueueTest, unittest.TestCase):

Callers

nothing calls this directly

Calls 5

gc_collectFunction · 0.90
assertIsNoneMethod · 0.80
CClass · 0.70
putMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected