[Python-checkins] python/dist/src/Lib/test test_queue.py,1.3,1.4
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Fri, 15 Nov 2002 11:08:54 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv24294/python/Lib/test
Modified Files:
test_queue.py
Log Message:
Style guide reformats. I saw this test fail on a very heavily loaded
Win98SE box, but whatever the cause, it had scrolled off the DOS box.
(There was just the "test_queue failed" summary at the end of the
regrtest run.)
Index: test_queue.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_queue.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_queue.py 15 Oct 2002 15:11:13 -0000 1.3
--- test_queue.py 15 Nov 2002 19:08:50 -0000 1.4
***************
*** 23,27 ****
self.fn(*self.args)
! def _doBlockingTest( block_func, block_args, trigger_func, trigger_args):
t = _TriggerThread(trigger_func, trigger_args)
t.start()
--- 23,27 ----
self.fn(*self.args)
! def _doBlockingTest(block_func, block_args, trigger_func, trigger_args):
t = _TriggerThread(trigger_func, trigger_args)
t.start()
***************
*** 31,38 ****
# If we unblocked before our thread made the call, we failed!
if not t.startedEvent.isSet():
! raise TestFailed("blocking function '%r' appeared not to block" % (block_func,))
t.join(1) # make sure the thread terminates
if t.isAlive():
! raise TestFailed("trigger function '%r' appeared to not return" % (trigger_func,))
# A Queue subclass that can provoke failure at a moment's notice :)
--- 31,40 ----
# If we unblocked before our thread made the call, we failed!
if not t.startedEvent.isSet():
! raise TestFailed("blocking function '%r' appeared not to block" %
! block_func)
t.join(1) # make sure the thread terminates
if t.isAlive():
! raise TestFailed("trigger function '%r' appeared to not return" %
! trigger_func)
# A Queue subclass that can provoke failure at a moment's notice :)
***************
*** 141,145 ****
q.put(111)
q.put(222)
! verify(q.get()==111 and q.get()==222, "Didn't seem to queue the correct data!")
for i in range(queue_size-1):
q.put(i)
--- 143,148 ----
q.put(111)
q.put(222)
! verify(q.get() == 111 and q.get() == 222,
! "Didn't seem to queue the correct data!")
for i in range(queue_size-1):
q.put(i)
***************
*** 175,180 ****
pass
# Test a blocking get
! _doBlockingTest( q.get, (), q.put, ('empty',))
! _doBlockingTest( q.get, (True, 0.2), q.put, ('empty',))
def test():
--- 178,183 ----
pass
# Test a blocking get
! _doBlockingTest(q.get, (), q.put, ('empty',))
! _doBlockingTest(q.get, (True, 0.2), q.put, ('empty',))
def test():