diff --git a/tests/__init__.py b/tests/__init__.py index 7caef1d..3ff9229 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -19,7 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# package is named greentest, not test, so it won't be confused with test in stdlib +# package is named tests, not test, so it won't be confused with test in stdlib import sys import os import errno diff --git a/tests/generate_report.py b/tests/generate_report.py index ff5ec7f..f6e1dc7 100644 --- a/tests/generate_report.py +++ b/tests/generate_report.py @@ -152,7 +152,7 @@ class TestResult: return '%s' % (valign, self.color(), text) def format_testname(changeset, test): - return '%s' % (REPO_URL, changeset, test, test) + return '%s' % (REPO_URL, changeset, test, test) def format_table(table, hubs, tests, hub_stats, changeset): r = '\n\n
\n' diff --git a/tests/pools_test.py b/tests/pools_test.py index 7edb1d1..094dbf2 100644 --- a/tests/pools_test.py +++ b/tests/pools_test.py @@ -219,39 +219,6 @@ SOMETIMES = RuntimeError('I fail half the time') class TestTookTooLong(Exception): pass -class TestFan(TestCase): - mode = 'static' - def setUp(self): - self.timer = api.exc_after(1, TestTookTooLong()) - self.pool = IntPool(max_size=2) - - def tearDown(self): - self.timer.cancel() - - def test_with_list(self): - list_of_input = ['agent-one', 'agent-two', 'agent-three'] - - def my_callable(pool_item, next_thing): - ## Do some "blocking" (yielding) thing - api.sleep(0.01) - return next_thing - - output = self.pool.fan(my_callable, list_of_input) - self.assertEquals(list_of_input, output) - - def test_all_fail(self): - def my_failure(pool_item, next_thing): - raise ALWAYS - self.assertRaises(pools.AllFailed, self.pool.fan, my_failure, range(4)) - - def test_some_fail(self): - def my_failing_callable(pool_item, next_thing): - if next_thing % 2: - raise SOMETIMES - return next_thing - self.assertRaises(pools.SomeFailed, self.pool.fan, my_failing_callable, range(4)) - - if __name__ == '__main__': main() diff --git a/tests/record_results.py b/tests/record_results.py index 3dd3728..c0eee51 100644 --- a/tests/record_results.py +++ b/tests/record_results.py @@ -32,7 +32,7 @@ try: except ImportError: import pysqlite2.dbapi2 as sqlite3 import warnings -from greentest import disabled_marker +from tests import disabled_marker warnings.simplefilter('ignore') diff --git a/tests/saranwrap_test.py b/tests/saranwrap_test.py index d6ad3c8..acfe3ba 100644 --- a/tests/saranwrap_test.py +++ b/tests/saranwrap_test.py @@ -245,7 +245,7 @@ class TestSaranwrap(unittest.TestCase): tid = make_uuid() self.assertEqual(tid.get_version(), uuid.uuid4().get_version()) def make_list(): - from greentest import saranwrap_test + from tests import saranwrap_test prox = saranwrap.wrap(saranwrap_test.list_maker) # after this function returns, prox should fall out of scope return prox() @@ -290,7 +290,7 @@ sys_path = sys.path""") sys.path.remove(temp_dir) def test_contention(self): - from greentest import saranwrap_test + from tests import saranwrap_test prox = saranwrap.wrap(saranwrap_test) pool = Pool(max_size=4) @@ -316,7 +316,7 @@ sys_path = sys.path""") def test_list_of_functions(self): return # this test is known to fail, we can implement it sometime in the future if we wish - from greentest import saranwrap_test + from tests import saranwrap_test prox = saranwrap.wrap([saranwrap_test.list_maker]) self.assertEquals(list_maker(), prox[0]()) @@ -325,7 +325,7 @@ sys_path = sys.path""") # a function. Then we want to saranwrap that class, have # the object call the coroutine and verify that it ran - from greentest import saranwrap_test + from tests import saranwrap_test mod_proxy = saranwrap.wrap(saranwrap_test) obj_proxy = mod_proxy.CoroutineCallingClass() obj_proxy.run_coroutine() diff --git a/tests/test__coros_queue.py b/tests/test__coros_queue.py index cc58e63..c8e1b0b 100644 --- a/tests/test__coros_queue.py +++ b/tests/test__coros_queue.py @@ -1,4 +1,4 @@ -from greentest import LimitedTestCase +from tests import LimitedTestCase from unittest import main from eventlet import api, coros, proc diff --git a/tests/test__coros_semaphore.py b/tests/test__coros_semaphore.py index cf33895..da812ff 100644 --- a/tests/test__coros_semaphore.py +++ b/tests/test__coros_semaphore.py @@ -21,7 +21,7 @@ import unittest from eventlet import api, coros -from greentest import LimitedTestCase +from tests import LimitedTestCase class TestSemaphore(LimitedTestCase): diff --git a/tests/test__event.py b/tests/test__event.py index 311ddbe..5b8dcb7 100644 --- a/tests/test__event.py +++ b/tests/test__event.py @@ -22,7 +22,7 @@ import unittest from eventlet.coros import event from eventlet.api import spawn, sleep, exc_after, with_timeout -from greentest import LimitedTestCase +from tests import LimitedTestCase DELAY= 0.01 diff --git a/tests/test__greenness.py b/tests/test__greenness.py index 282902f..62010b0 100644 --- a/tests/test__greenness.py +++ b/tests/test__greenness.py @@ -24,7 +24,7 @@ To do that spawn a green server and then access it using a green socket. If either operation blocked the whole script would block and timeout. """ import unittest -from greentest import test_support +from tests import test_support from eventlet.green import urllib2, BaseHTTPServer from eventlet.api import spawn, kill diff --git a/tests/test__pool.py b/tests/test__pool.py index a451e25..de515cf 100644 --- a/tests/test__pool.py +++ b/tests/test__pool.py @@ -1,5 +1,5 @@ from eventlet import pool, coros, api -from greentest import LimitedTestCase +from tests import LimitedTestCase from unittest import main class TestCoroutinePool(LimitedTestCase): diff --git a/tests/test__proc.py b/tests/test__proc.py index 7d93f39..2541858 100644 --- a/tests/test__proc.py +++ b/tests/test__proc.py @@ -23,7 +23,7 @@ import sys import unittest from eventlet.api import sleep, with_timeout from eventlet import api, proc, coros -from greentest import LimitedTestCase +from tests import LimitedTestCase DELAY = 0.01 diff --git a/tests/test__twistedutil.py b/tests/test__twistedutil.py index 7e5c8ad..39913e3 100644 --- a/tests/test__twistedutil.py +++ b/tests/test__twistedutil.py @@ -20,7 +20,7 @@ # THE SOFTWARE. from twisted.internet import reactor -from greentest import exit_unless_twisted +from tests import exit_unless_twisted exit_unless_twisted() import unittest from twisted.internet.error import DNSLookupError diff --git a/tests/test__twistedutil_protocol.py b/tests/test__twistedutil_protocol.py index 3da5aec..9f96249 100644 --- a/tests/test__twistedutil_protocol.py +++ b/tests/test__twistedutil_protocol.py @@ -20,7 +20,7 @@ # THE SOFTWARE. from twisted.internet import reactor -from greentest import exit_unless_twisted +from tests import exit_unless_twisted exit_unless_twisted() import unittest diff --git a/tests/test_socket.py b/tests/test_socket.py index ff33a43..f0db77f 100644 --- a/tests/test_socket.py +++ b/tests/test_socket.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import unittest -from greentest import test_support +from tests import test_support from eventlet.green import socket from eventlet.green import select diff --git a/tests/test_socket_ssl.py b/tests/test_socket_ssl.py index 818fdc4..86c1c60 100644 --- a/tests/test_socket_ssl.py +++ b/tests/test_socket_ssl.py @@ -1,7 +1,7 @@ # Test just the SSL support in the socket module, in a moderately bogus way. import sys -from greentest import test_support +from tests import test_support from eventlet.green import socket import errno import unittest diff --git a/tests/test_socketserver.py b/tests/test_socketserver.py index 0361f89..8e5ad62 100644 --- a/tests/test_socketserver.py +++ b/tests/test_socketserver.py @@ -1,8 +1,8 @@ # Test suite for SocketServer.py # converted to unittest (Denis) -from greentest import test_support -from greentest.test_support import (verbose, verify, TESTFN, TestSkipped, +from tests import test_support +from tests.test_support import (verbose, verify, TESTFN, TestSkipped, reap_children) test_support.requires('network') diff --git a/tests/test_support.py b/tests/test_support.py index 0b4494c..cd2d5f0 100644 --- a/tests/test_support.py +++ b/tests/test_support.py @@ -1,6 +1,6 @@ """Supporting definitions for the Python regression tests.""" -if __name__ != 'greentest.test_support': +if __name__ != 'tests.test_support': raise ImportError, 'test_support must be imported from the test package' import sys diff --git a/tests/test_thread.py b/tests/test_thread.py index b4d9bb1..9040e6a 100644 --- a/tests/test_thread.py +++ b/tests/test_thread.py @@ -2,7 +2,7 @@ # Create a bunch of threads, let each do some work, wait until all are done -from greentest.test_support import verbose +from tests.test_support import verbose import random from eventlet.green import thread from eventlet.green import time diff --git a/tests/test_threading.py b/tests/test_threading.py index 08bf39d..22b856c 100644 --- a/tests/test_threading.py +++ b/tests/test_threading.py @@ -1,7 +1,7 @@ # Very rudimentary test of threading module -import greentest.test_support -from greentest.test_support import verbose +import tests.test_support +from tests.test_support import verbose import random import sys from eventlet.green import threading @@ -299,7 +299,7 @@ class ThreadJoinOnShutdown(unittest.TestCase): def test_main(): - greentest.test_support.run_unittest(ThreadTests, + tests.test_support.run_unittest(ThreadTests, ThreadJoinOnShutdown) if __name__ == "__main__": diff --git a/tests/test_threading_local.py b/tests/test_threading_local.py index f505459..b8114cf 100644 --- a/tests/test_threading_local.py +++ b/tests/test_threading_local.py @@ -1,6 +1,6 @@ import unittest from doctest import DocTestSuite -from greentest import test_support +from tests import test_support class ThreadingLocalTest(unittest.TestCase): def test_derived(self): diff --git a/tests/test_timeout.py b/tests/test_timeout.py index 982c443..d63cda6 100644 --- a/tests/test_timeout.py +++ b/tests/test_timeout.py @@ -1,7 +1,7 @@ """Unit tests for socket timeout feature.""" import unittest -from greentest import test_support +from tests import test_support # This requires the 'network' resource as given on the regrtest command line. skip_expected = not test_support.is_resource_enabled('network') diff --git a/tests/test_urllib2.py b/tests/test_urllib2.py index 77f0a03..298a683 100644 --- a/tests/test_urllib2.py +++ b/tests/test_urllib2.py @@ -1,5 +1,5 @@ import unittest -from greentest import test_support +from tests import test_support import os from eventlet.green import socket diff --git a/tests/test_urllib2_localnet.py b/tests/test_urllib2_localnet.py index 9008241..ceabc2d 100644 --- a/tests/test_urllib2_localnet.py +++ b/tests/test_urllib2_localnet.py @@ -1,12 +1,12 @@ #!/usr/bin/env python -from greentest import exit_unless_25; exit_unless_25() +from tests import exit_unless_25; exit_unless_25() import sys import urlparse import unittest import hashlib -from greentest import test_support +from tests import test_support from eventlet.green import threading from eventlet.green import socket from eventlet.green import urllib2 diff --git a/tests/tpool_test.py b/tests/tpool_test.py index 4ffada1..672b040 100644 --- a/tests/tpool_test.py +++ b/tests/tpool_test.py @@ -165,7 +165,7 @@ class TestTpool(TestCase): self.assertEqual(opts.n, 'foo') def test_contention(self): - from greentest import tpool_test + from tests import tpool_test prox = tpool.Proxy(tpool_test) pool = coros.CoroutinePool(max_size=4) diff --git a/tests/with_timeout.py b/tests/with_timeout.py index db33f69..14d8ad4 100644 --- a/tests/with_timeout.py +++ b/tests/with_timeout.py @@ -98,7 +98,7 @@ elif sys.argv[1:]==['--selftest1']: pass def test_long(self): time.sleep(10) - from greentest import test_support + from tests import test_support test_support.run_unittest(Test) sys.exit(0) elif sys.argv[1:]==['--selftest2']: @@ -108,7 +108,7 @@ elif sys.argv[1:]==['--selftest2']: fail def test_long(self): time.sleep(10) - from greentest import test_support + from tests import test_support test_support.run_unittest(Test) sys.exit(0) diff --git a/tests/wsgi_test.py b/tests/wsgi_test.py index 50fb75c..fcda3cb 100644 --- a/tests/wsgi_test.py +++ b/tests/wsgi_test.py @@ -29,7 +29,7 @@ from eventlet import util from eventlet import wsgi from eventlet import processes -from greentest import find_command +from tests import find_command try: from cStringIO import StringIO