summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_queue.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-01-08 18:41:40 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-01-08 18:41:40 (GMT)
commit3ddc435af6873c6304058d7bcbcb19ee4fba7781 (patch)
treec7a03cf0a8b856bae2ebebba55b09f775845c7ca /Lib/test/test_queue.py
parent3194d1454cbc11ec477d83fff3fc749972107d29 (diff)
downloadcpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.zip
cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.tar.gz
cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.tar.bz2
Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox
Diffstat (limited to 'Lib/test/test_queue.py')
-rw-r--r--Lib/test/test_queue.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index 2fa36b7..e6d2e69 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -7,7 +7,8 @@ import time
import unittest
from test import test_support
-QUEUE_SIZE = 5
+QUEUE_SIZE = LAST = 5
+FULL = LAST+1
# A thread to run a function that unclogs a blocked Queue.
class _TriggerThread(threading.Thread):
@@ -102,21 +103,21 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
q.put(i)
self.assertTrue(not q.empty(), "Queue should not be empty")
self.assertTrue(not q.full(), "Queue should not be full")
- q.put("last")
+ q.put(LAST)
self.assertTrue(q.full(), "Queue should be full")
try:
- q.put("full", block=0)
+ q.put(FULL, block=0)
self.fail("Didn't appear to block with a full queue")
except Queue.Full:
pass
try:
- q.put("full", timeout=0.01)
+ q.put(FULL, timeout=0.01)
self.fail("Didn't appear to time-out with a full queue")
except Queue.Full:
pass
# Test a blocking put
- self.do_blocking_test(q.put, ("full",), q.get, ())
- self.do_blocking_test(q.put, ("full", True, 10), q.get, ())
+ self.do_blocking_test(q.put, (FULL,), q.get, ())
+ self.do_blocking_test(q.put, (FULL, True, 10), q.get, ())
# Empty it
for i in range(QUEUE_SIZE):
q.get()