diff options
author | Raymond Hettinger <python@rcn.com> | 2010-10-31 17:57:52 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-10-31 17:57:52 (GMT) |
commit | 189316a2e35eede0de61c4713777c2b8e04c2e99 (patch) | |
tree | 70f0c6ffa126bfd9902d6c7880490bbea7229c78 /Lib/test/test_queue.py | |
parent | d285bdb4434a57126f7f17dc6b8f78204c180c1f (diff) | |
download | cpython-189316a2e35eede0de61c4713777c2b8e04c2e99.zip cpython-189316a2e35eede0de61c4713777c2b8e04c2e99.tar.gz cpython-189316a2e35eede0de61c4713777c2b8e04c2e99.tar.bz2 |
Issue 10110: Let Queue.put recognize a full queue when the maxsize parameter has been reduced.
Diffstat (limited to 'Lib/test/test_queue.py')
-rw-r--r-- | Lib/test/test_queue.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 0c8093a..5cef90c 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -216,6 +216,18 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin): with self.assertRaises(queue.Empty): q.get_nowait() + def test_shrinking_queue(self): + # issue 10110 + q = self.type2test(3) + q.put(1) + q.put(2) + q.put(3) + with self.assertRaises(queue.Full): + q.put_nowait(4) + self.assertEqual(q.qsize(), 3) + q.maxsize = 2 # shrink the queue + with self.assertRaises(queue.Full): + q.put_nowait(4) class QueueTest(BaseQueueTest): type2test = queue.Queue |