MCPcopy Index your code
hub / github.com/python/cpython / test_shrinking_queue

Method test_shrinking_queue

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

Source from the content-addressed store, hash-verified

231 q.get_nowait()
232
233 def test_shrinking_queue(self):
234 # issue 10110
235 q = self.type2test(3)
236 q.put(1)
237 q.put(2)
238 q.put(3)
239 with self.assertRaises(self.queue.Full):
240 q.put_nowait(4)
241 self.assertEqual(q.qsize(), 3)
242 q.maxsize = 2 # shrink the queue
243 with self.assertRaises(self.queue.Full):
244 q.put_nowait(4)
245
246 def test_shutdown_empty(self):
247 q = self.type2test()

Callers

nothing calls this directly

Calls 6

type2testMethod · 0.80
putMethod · 0.45
assertRaisesMethod · 0.45
put_nowaitMethod · 0.45
assertEqualMethod · 0.45
qsizeMethod · 0.45

Tested by

no test coverage detected