summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_queue.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
commitab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch)
tree6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_queue.py
parentef82be368abdea8e8032500e7ecc3a22f5f07851 (diff)
downloadcpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
Diffstat (limited to 'Lib/test/test_queue.py')
-rw-r--r--Lib/test/test_queue.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index 22cdcad..95f80ac 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -103,12 +103,12 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
"Didn't seem to queue the correct data!")
for i in range(QUEUE_SIZE-1):
q.put(i)
- self.assert_(q.qsize(), "Queue should not be empty")
- self.assert_(not qfull(q), "Queue should not be full")
+ self.assertTrue(q.qsize(), "Queue should not be empty")
+ self.assertTrue(not qfull(q), "Queue should not be full")
last = 2 * QUEUE_SIZE
full = 3 * 2 * QUEUE_SIZE
q.put(last)
- self.assert_(qfull(q), "Queue should be full")
+ self.assertTrue(qfull(q), "Queue should be full")
try:
q.put(full, block=0)
self.fail("Didn't appear to block with a full queue")
@@ -125,7 +125,7 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
# Empty it
for i in range(QUEUE_SIZE):
q.get()
- self.assert_(not q.qsize(), "Queue should be empty")
+ self.assertTrue(not q.qsize(), "Queue should be empty")
try:
q.get(block=0)
self.fail("Didn't appear to block with an empty queue")
@@ -247,7 +247,7 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
except FailingQueueException:
pass
q.put("last")
- self.assert_(qfull(q), "Queue should be full")
+ self.assertTrue(qfull(q), "Queue should be full")
# Test a failing blocking put
q.fail_next_put = True
try:
@@ -269,17 +269,17 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
# Check the Queue isn't damaged.
# put failed, but get succeeded - re-add
q.put("last")
- self.assert_(qfull(q), "Queue should be full")
+ self.assertTrue(qfull(q), "Queue should be full")
q.get()
- self.assert_(not qfull(q), "Queue should not be full")
+ self.assertTrue(not qfull(q), "Queue should not be full")
q.put("last")
- self.assert_(qfull(q), "Queue should be full")
+ self.assertTrue(qfull(q), "Queue should be full")
# Test a blocking put
self.do_blocking_test(q.put, ("full",), q.get, ())
# Empty it
for i in range(QUEUE_SIZE):
q.get()
- self.assert_(not q.qsize(), "Queue should be empty")
+ self.assertTrue(not q.qsize(), "Queue should be empty")
q.put("first")
q.fail_next_get = True
try:
@@ -287,16 +287,16 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
self.fail("The queue didn't fail when it should have")
except FailingQueueException:
pass
- self.assert_(q.qsize(), "Queue should not be empty")
+ self.assertTrue(q.qsize(), "Queue should not be empty")
q.fail_next_get = True
try:
q.get(timeout=0.1)
self.fail("The queue didn't fail when it should have")
except FailingQueueException:
pass
- self.assert_(q.qsize(), "Queue should not be empty")
+ self.assertTrue(q.qsize(), "Queue should not be empty")
q.get()
- self.assert_(not q.qsize(), "Queue should be empty")
+ self.assertTrue(not q.qsize(), "Queue should be empty")
q.fail_next_get = True
try:
self.do_exceptional_blocking_test(q.get, (), q.put, ('empty',),
@@ -305,9 +305,9 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
except FailingQueueException:
pass
# put succeeded, but get failed.
- self.assert_(q.qsize(), "Queue should not be empty")
+ self.assertTrue(q.qsize(), "Queue should not be empty")
q.get()
- self.assert_(not q.qsize(), "Queue should be empty")
+ self.assertTrue(not q.qsize(), "Queue should be empty")
def test_failing_queue(self):
# Test to make sure a queue is functioning correctly.