diff options
author | Georg Brandl <georg@python.org> | 2008-05-25 07:20:14 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-25 07:20:14 (GMT) |
commit | a6168f9e0a0ff77910e783df36f5dd4b5dfa7372 (patch) | |
tree | 5424d6e36503bda00ee3a63638737a9973b4a4fb /Lib/test | |
parent | 8107290fa186bd5efa2a9c158000fd578d228a6c (diff) | |
download | cpython-a6168f9e0a0ff77910e783df36f5dd4b5dfa7372.zip cpython-a6168f9e0a0ff77910e783df36f5dd4b5dfa7372.tar.gz cpython-a6168f9e0a0ff77910e783df36f5dd4b5dfa7372.tar.bz2 |
Queue renaming reversal part 3: move module into place and
change imports and other references. Closes #2925.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test___all__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_dummy_thread.py | 6 | ||||
-rw-r--r-- | Lib/test/test_py3kwarn.py | 4 | ||||
-rw-r--r-- | Lib/test/test_queue.py | 24 | ||||
-rw-r--r-- | Lib/test/test_socket.py | 4 |
5 files changed, 19 insertions, 21 deletions
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index ec58c14..57933d2 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -40,7 +40,7 @@ class AllTest(unittest.TestCase): self.check_all("configparser") self.check_all("Cookie") self.check_all("MimeWriter") - self.check_all("queue") + self.check_all("Queue") self.check_all("SimpleHTTPServer") self.check_all("SocketServer") self.check_all("StringIO") diff --git a/Lib/test/test_dummy_thread.py b/Lib/test/test_dummy_thread.py index fa87af9..f274e0a 100644 --- a/Lib/test/test_dummy_thread.py +++ b/Lib/test/test_dummy_thread.py @@ -7,7 +7,7 @@ implementation as its sole argument. """ import dummy_thread as _thread import time -import queue +import Queue import random import unittest from test import test_support @@ -124,7 +124,7 @@ class ThreadTests(unittest.TestCase): """Use to test _thread.start_new_thread() passes args properly.""" queue.put((arg1, arg2)) - testing_queue = queue.Queue(1) + testing_queue = Queue.Queue(1) _thread.start_new_thread(arg_tester, (testing_queue, True, True)) result = testing_queue.get() self.failUnless(result[0] and result[1], @@ -148,7 +148,7 @@ class ThreadTests(unittest.TestCase): queue.put(_thread.get_ident()) thread_count = 5 - testing_queue = queue.Queue(thread_count) + testing_queue = Queue.Queue(thread_count) if test_support.verbose: print print "*** Testing multiple thread creation "\ diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 5a9421f..a456154 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -215,9 +215,7 @@ class TestStdlibRemovals(unittest.TestCase): class TestStdlibRenames(unittest.TestCase): - renames = {'Queue': 'queue', - 'ConfigParser': 'configparser', - } + renames = {'ConfigParser': 'configparser'} def check_rename(self, module_name, new_module_name): """Make sure that: diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 7cc9329..660e177 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -1,6 +1,6 @@ # Some simple queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. -import queue +import Queue import sys import threading import time @@ -107,12 +107,12 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin): try: q.put("full", block=0) self.fail("Didn't appear to block with a full queue") - except queue.Full: + except Queue.Full: pass try: q.put("full", timeout=0.01) self.fail("Didn't appear to time-out with a full queue") - except queue.Full: + except Queue.Full: pass # Test a blocking put self.do_blocking_test(q.put, ("full",), q.get, ()) @@ -124,12 +124,12 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin): try: q.get(block=0) self.fail("Didn't appear to block with an empty queue") - except queue.Empty: + except Queue.Empty: pass try: q.get(timeout=0.01) self.fail("Didn't appear to time-out with an empty queue") - except queue.Empty: + except Queue.Empty: pass # Test a blocking get self.do_blocking_test(q.get, (), q.put, ('empty',)) @@ -191,13 +191,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin): class QueueTest(BaseQueueTest): - type2test = queue.Queue + type2test = Queue.Queue class LifoQueueTest(BaseQueueTest): - type2test = queue.LifoQueue + type2test = Queue.LifoQueue class PriorityQueueTest(BaseQueueTest): - type2test = queue.PriorityQueue + type2test = Queue.PriorityQueue @@ -205,21 +205,21 @@ class PriorityQueueTest(BaseQueueTest): class FailingQueueException(Exception): pass -class FailingQueue(queue.Queue): +class FailingQueue(Queue.Queue): def __init__(self, *args): self.fail_next_put = False self.fail_next_get = False - queue.Queue.__init__(self, *args) + Queue.Queue.__init__(self, *args) def _put(self, item): if self.fail_next_put: self.fail_next_put = False raise FailingQueueException, "You Lose" - return queue.Queue._put(self, item) + return Queue.Queue._put(self, item) def _get(self): if self.fail_next_get: self.fail_next_get = False raise FailingQueueException, "You Lose" - return queue.Queue._get(self) + return Queue.Queue._get(self) class FailingQueueTest(unittest.TestCase, BlockingTestMixin): diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 81ef6d3..48c9346 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -9,7 +9,7 @@ import select import thread, threading import time import traceback -import queue +import Queue import sys import os import array @@ -96,7 +96,7 @@ class ThreadableTest: self.server_ready = threading.Event() self.client_ready = threading.Event() self.done = threading.Event() - self.queue = queue.Queue(1) + self.queue = Queue.Queue(1) # Do some munging to start the client test. methodname = self.id() |