diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2015-07-14 11:51:04 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@gmail.com> | 2015-07-25 18:54:22 -0700 |
| commit | 2d4ce6bf7b93dd1f0d1c472442e0abd0b20ee87c (patch) | |
| tree | e5f6c350a4c9e4d45b94b4f76cb85582823b39f6 /taskflow/tests/unit/test_utils_async_utils.py | |
| parent | 6bc943bb5d1c150259e0a30e9b15bbfaa5aafec7 (diff) | |
| download | taskflow-2d4ce6bf7b93dd1f0d1c472442e0abd0b20ee87c.tar.gz | |
Bump futurist and remove waiting code in taskflow
Change-Id: Ifc9780aa129a4a2804cead301a519895c2bfc0b5
Diffstat (limited to 'taskflow/tests/unit/test_utils_async_utils.py')
| -rw-r--r-- | taskflow/tests/unit/test_utils_async_utils.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/taskflow/tests/unit/test_utils_async_utils.py b/taskflow/tests/unit/test_utils_async_utils.py index 1f8b011..bd8b9a6 100644 --- a/taskflow/tests/unit/test_utils_async_utils.py +++ b/taskflow/tests/unit/test_utils_async_utils.py @@ -14,56 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -import futurist -import testtools - from taskflow import test from taskflow.utils import async_utils as au -from taskflow.utils import eventlet_utils as eu - - -class WaitForAnyTestsMixin(object): - timeout = 0.001 - - def test_waits_and_finishes(self): - def foo(): - pass - - with self._make_executor(2) as e: - fs = [e.submit(foo), e.submit(foo)] - # this test assumes that our foo will end within 10 seconds - done, not_done = au.wait_for_any(fs, 10) - self.assertIn(len(done), (1, 2)) - self.assertTrue(any(f in done for f in fs)) - - def test_not_done_futures(self): - fs = [futurist.Future(), futurist.Future()] - done, not_done = au.wait_for_any(fs, self.timeout) - self.assertEqual(len(done), 0) - self.assertEqual(len(not_done), 2) - - def test_mixed_futures(self): - f1 = futurist.Future() - f2 = futurist.Future() - f2.set_result(1) - done, not_done = au.wait_for_any([f1, f2], self.timeout) - self.assertEqual(len(done), 1) - self.assertEqual(len(not_done), 1) - self.assertIs(not_done.pop(), f1) - self.assertIs(done.pop(), f2) - - -@testtools.skipIf(not eu.EVENTLET_AVAILABLE, 'eventlet is not available') -class AsyncUtilsEventletTest(test.TestCase, - WaitForAnyTestsMixin): - def _make_executor(self, max_workers): - return futurist.GreenThreadPoolExecutor(max_workers=max_workers) - - -class AsyncUtilsThreadedTest(test.TestCase, - WaitForAnyTestsMixin): - def _make_executor(self, max_workers): - return futurist.ThreadPoolExecutor(max_workers=max_workers) class MakeCompletedFutureTest(test.TestCase): @@ -73,9 +25,3 @@ class MakeCompletedFutureTest(test.TestCase): future = au.make_completed_future(result) self.assertTrue(future.done()) self.assertIs(future.result(), result) - - -class AsyncUtilsSynchronousTest(test.TestCase, - WaitForAnyTestsMixin): - def _make_executor(self, max_workers): - return futurist.SynchronousExecutor() |
