summaryrefslogtreecommitdiff
path: root/Lib/test/test_queue.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-01-08 19:04:16 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-01-08 19:04:16 +0000
commitce8e33a095030e7af94f58f9da196b240bdf0476 (patch)
treeb0ba50cbb6e85c6be6f6e6a870e4232be50a0f9c /Lib/test/test_queue.py
parent3ddc435af6873c6304058d7bcbcb19ee4fba7781 (diff)
downloadcpython-git-ce8e33a095030e7af94f58f9da196b240bdf0476.tar.gz
Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
Diffstat (limited to 'Lib/test/test_queue.py')
-rw-r--r--Lib/test/test_queue.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index e6d2e69613..2fa36b7593 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -7,8 +7,7 @@ import time
import unittest
from test import test_support
-QUEUE_SIZE = LAST = 5
-FULL = LAST+1
+QUEUE_SIZE = 5
# A thread to run a function that unclogs a blocked Queue.
class _TriggerThread(threading.Thread):
@@ -103,21 +102,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()