(self)
| 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 | |
| 1013 | class PySimpleQueueTest(BaseSimpleQueueTest, unittest.TestCase): |
nothing calls this directly
no test coverage detected